diff --git a/prisma/migrations/20240910085032_fix_missing_field/migration.sql b/prisma/migrations/20240910085032_fix_missing_field/migration.sql new file mode 100644 index 0000000..5d2e869 --- /dev/null +++ b/prisma/migrations/20240910085032_fix_missing_field/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable +ALTER TABLE "Product" ADD COLUMN "selectedImage" TEXT; + +-- AlterTable +ALTER TABLE "Service" ADD COLUMN "selectedImage" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 8dea411..a7af8dc 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -692,7 +692,8 @@ model Product { shared Boolean @default(false) - remark String? + remark String? + selectedImage String? productGroup ProductGroup @relation(fields: [productGroupId], references: [id], onDelete: Cascade) productGroupId String @@ -719,7 +720,8 @@ model Service { status Status @default(CREATED) statusOrder Int @default(0) - shared Boolean @default(false) + shared Boolean @default(false) + selectedImage String? work Work[] quotationService QuotationService[] diff --git a/src/controllers/04-product-controller.ts b/src/controllers/04-product-controller.ts index 384b9c4..e1a4efb 100644 --- a/src/controllers/04-product-controller.ts +++ b/src/controllers/04-product-controller.ts @@ -69,6 +69,8 @@ type ProductCreate = { serviceCharge: number; vatIncluded?: boolean; expenseType?: string; + selectedImage?: string; + shared?: boolean; productGroupId: string; remark?: string; }; @@ -84,6 +86,8 @@ type ProductUpdate = { remark?: string; vatIncluded?: boolean; expenseType?: string; + selectedImage?: string; + shared?: boolean; productGroupId?: string; }; diff --git a/src/controllers/04-service-controller.ts b/src/controllers/04-service-controller.ts index 025ab77..1d349aa 100644 --- a/src/controllers/04-service-controller.ts +++ b/src/controllers/04-service-controller.ts @@ -58,6 +58,8 @@ type ServiceCreate = { productId: string[]; attributes?: { [key: string]: any }; }[]; + shared?: boolean; + selectedImage?: string; productGroupId: string; }; @@ -73,6 +75,8 @@ type ServiceUpdate = { productId: string[]; attributes?: { [key: string]: any }; }[]; + shared?: boolean; + selectedImage?: string; productGroupId?: string; };