This commit is contained in:
+1
-1
Submodule graphql-contracts updated: d2dea0a67e...93b8e21325
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "exchange_products" ADD COLUMN "image_url" VARCHAR(500);
|
||||||
@@ -58,6 +58,7 @@ model Product {
|
|||||||
name String @db.VarChar(255)
|
name String @db.VarChar(255)
|
||||||
categoryName String @default("") @map("category_name") @db.VarChar(255)
|
categoryName String @default("") @map("category_name") @db.VarChar(255)
|
||||||
unit String @default("ton") @db.VarChar(20)
|
unit String @default("ton") @db.VarChar(20)
|
||||||
|
imageUrl String? @map("image_url") @db.VarChar(500)
|
||||||
description String?
|
description String?
|
||||||
isActive Boolean @default(true) @map("is_active")
|
isActive Boolean @default(true) @map("is_active")
|
||||||
createdAt DateTime @default(now()) @map("created_at")
|
createdAt DateTime @default(now()) @map("created_at")
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const products = [
|
|||||||
name: 'Solar panels',
|
name: 'Solar panels',
|
||||||
categoryName: 'Equipment',
|
categoryName: 'Equipment',
|
||||||
unit: 'pallet',
|
unit: 'pallet',
|
||||||
|
imageUrl: 'https://images.unsplash.com/photo-1509391366360-2e959784a276?auto=format&fit=crop&w=900&q=80',
|
||||||
description: 'Demo exchange product',
|
description: 'Demo exchange product',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -18,6 +19,7 @@ const products = [
|
|||||||
name: 'Industrial pumps',
|
name: 'Industrial pumps',
|
||||||
categoryName: 'Equipment',
|
categoryName: 'Equipment',
|
||||||
unit: 'unit',
|
unit: 'unit',
|
||||||
|
imageUrl: 'https://images.unsplash.com/photo-1581092160607-ee22621dd758?auto=format&fit=crop&w=900&q=80',
|
||||||
description: 'Demo exchange product',
|
description: 'Demo exchange product',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -26,6 +28,7 @@ const products = [
|
|||||||
name: 'Soybean meal',
|
name: 'Soybean meal',
|
||||||
categoryName: 'Agriculture',
|
categoryName: 'Agriculture',
|
||||||
unit: 'ton',
|
unit: 'ton',
|
||||||
|
imageUrl: 'https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=900&q=80',
|
||||||
description: 'Demo exchange product',
|
description: 'Demo exchange product',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -38,6 +41,7 @@ const suppliers = [
|
|||||||
description: 'Demo solar panel supplier near Guangzhou rail terminal',
|
description: 'Demo solar panel supplier near Guangzhou rail terminal',
|
||||||
country: 'China',
|
country: 'China',
|
||||||
countryCode: 'CN',
|
countryCode: 'CN',
|
||||||
|
logoUrl: 'https://ui-avatars.com/api/?name=Guangzhou+Solar+Factory&background=0B6BFF&color=fff&bold=true',
|
||||||
isVerified: true,
|
isVerified: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -47,6 +51,7 @@ const suppliers = [
|
|||||||
description: 'Demo industrial supplier near Yantian sea port',
|
description: 'Demo industrial supplier near Yantian sea port',
|
||||||
country: 'China',
|
country: 'China',
|
||||||
countryCode: 'CN',
|
countryCode: 'CN',
|
||||||
|
logoUrl: 'https://ui-avatars.com/api/?name=Shenzhen+Pump+Works&background=9F1239&color=fff&bold=true',
|
||||||
isVerified: true,
|
isVerified: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -56,6 +61,7 @@ const suppliers = [
|
|||||||
description: 'Demo agriculture supplier near rail export hub',
|
description: 'Demo agriculture supplier near rail export hub',
|
||||||
country: 'China',
|
country: 'China',
|
||||||
countryCode: 'CN',
|
countryCode: 'CN',
|
||||||
|
logoUrl: 'https://ui-avatars.com/api/?name=Harbin+Agro+Export&background=0F8A6A&color=fff&bold=true',
|
||||||
isVerified: true,
|
isVerified: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -65,6 +71,7 @@ const suppliers = [
|
|||||||
description: 'Demo Russian supplier near Far East port and rail',
|
description: 'Demo Russian supplier near Far East port and rail',
|
||||||
country: 'Russia',
|
country: 'Russia',
|
||||||
countryCode: 'RU',
|
countryCode: 'RU',
|
||||||
|
logoUrl: 'https://ui-avatars.com/api/?name=Vladivostok+Timber+Terminal&background=C45125&color=fff&bold=true',
|
||||||
isVerified: true,
|
isVerified: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ type ProductInput = {
|
|||||||
name: string
|
name: string
|
||||||
categoryName?: string | null
|
categoryName?: string | null
|
||||||
unit?: string | null
|
unit?: string | null
|
||||||
|
imageUrl?: string | null
|
||||||
description?: string | null
|
description?: string | null
|
||||||
isActive?: boolean | null
|
isActive?: boolean | null
|
||||||
}
|
}
|
||||||
@@ -56,6 +57,7 @@ export const typeDefs = `#graphql
|
|||||||
name: String!
|
name: String!
|
||||||
categoryName: String!
|
categoryName: String!
|
||||||
unit: String!
|
unit: String!
|
||||||
|
imageUrl: String
|
||||||
description: String
|
description: String
|
||||||
isActive: Boolean!
|
isActive: Boolean!
|
||||||
createdAt: String!
|
createdAt: String!
|
||||||
@@ -96,6 +98,7 @@ export const typeDefs = `#graphql
|
|||||||
name: String!
|
name: String!
|
||||||
categoryName: String
|
categoryName: String
|
||||||
unit: String
|
unit: String
|
||||||
|
imageUrl: String
|
||||||
description: String
|
description: String
|
||||||
isActive: Boolean
|
isActive: Boolean
|
||||||
}
|
}
|
||||||
@@ -158,6 +161,7 @@ function productData(input: ProductInput) {
|
|||||||
name: input.name,
|
name: input.name,
|
||||||
categoryName: input.categoryName ?? '',
|
categoryName: input.categoryName ?? '',
|
||||||
unit: input.unit ?? 'ton',
|
unit: input.unit ?? 'ton',
|
||||||
|
imageUrl: input.imageUrl ?? null,
|
||||||
description: input.description ?? null,
|
description: input.description ?? null,
|
||||||
isActive: input.isActive ?? true,
|
isActive: input.isActive ?? true,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user