From 077edee0399a296deba7c64d6b425e6f80f330ff Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:58:30 +0700 Subject: [PATCH] feat: add fields --- prisma/migrations/20240617105818_add_field/migration.sql | 9 +++++++++ prisma/schema.prisma | 2 ++ src/controllers/customer-controller.ts | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 prisma/migrations/20240617105818_add_field/migration.sql diff --git a/prisma/migrations/20240617105818_add_field/migration.sql b/prisma/migrations/20240617105818_add_field/migration.sql new file mode 100644 index 0000000..0aa2292 --- /dev/null +++ b/prisma/migrations/20240617105818_add_field/migration.sql @@ -0,0 +1,9 @@ +/* + Warnings: + + - Added the required column `personName` to the `Customer` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "Customer" ADD COLUMN "personName" TEXT NOT NULL, +ADD COLUMN "personNameEN" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 549218b..ee0089d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -332,6 +332,8 @@ enum CustomerType { model Customer { id String @id @default(uuid()) code String + personName String + personNameEN String? customerType CustomerType customerName String customerNameEN String diff --git a/src/controllers/customer-controller.ts b/src/controllers/customer-controller.ts index 73e662d..bb459c7 100644 --- a/src/controllers/customer-controller.ts +++ b/src/controllers/customer-controller.ts @@ -27,6 +27,8 @@ const MINIO_BUCKET = process.env.MINIO_BUCKET; export type CustomerCreate = { status?: Status; + personName: string; + personNameEN?: string; customerType: CustomerType; customerName: string; customerNameEN: string; @@ -67,6 +69,8 @@ export type CustomerCreate = { export type CustomerUpdate = { status?: "ACTIVE" | "INACTIVE"; + personName: string; + personNameEN?: string; customerType?: CustomerType; customerName?: string; customerNameEN?: string;