diff --git a/prisma/migrations/20241025020102_add_field/migration.sql b/prisma/migrations/20241025020102_add_field/migration.sql new file mode 100644 index 0000000..729d660 --- /dev/null +++ b/prisma/migrations/20241025020102_add_field/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "QuotationProductServiceList" ADD COLUMN "installmentNo" INTEGER; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 19ca1a7..ce5b029 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1208,6 +1208,8 @@ model QuotationProductServiceList { discount Float pricePerUnit Float + installmentNo Int? + productId String product Product @relation(fields: [productId], references: [id]) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 045d6ce..300481d 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -76,6 +76,7 @@ type QuotationCreate = { productId: string; amount: number; discount?: number; + installmentNo?: number; workerIndex?: number[]; }[]; }; @@ -130,6 +131,7 @@ type QuotationUpdate = { productId: string; amount: number; discount?: number; + installmentNo?: number; workerIndex?: number[]; }[]; }; @@ -412,6 +414,7 @@ export class QuotationController extends Controller { pricePerUnit, amount: v.amount, discount: v.discount || 0, + installmentNo: v.installmentNo, vat, worker: { create: sortedEmployeeId @@ -667,6 +670,7 @@ export class QuotationController extends Controller { pricePerUnit, amount: v.amount, discount: v.discount || 0, + installmentNo: v.installmentNo, vat, worker: { create: sortedEmployeeId