From 2232c2542b6df07ee4d248d74df3ec27ca0a3b60 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Mon, 11 Nov 2024 14:32:06 +0700 Subject: [PATCH] feat: add employee other fields --- .../20241111072949_add_checkup_fields/migration.sql | 2 ++ prisma/schema.prisma | 4 +++- src/controllers/03-employee-other-info-controller.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20241111072949_add_checkup_fields/migration.sql diff --git a/prisma/migrations/20241111072949_add_checkup_fields/migration.sql b/prisma/migrations/20241111072949_add_checkup_fields/migration.sql new file mode 100644 index 0000000..0777cde --- /dev/null +++ b/prisma/migrations/20241111072949_add_checkup_fields/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "EmployeeOtherInfo" ADD COLUMN "telephoneNo" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index a547211..c6b848b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -905,7 +905,9 @@ model EmployeeOtherInfo { employee Employee @relation(fields: [employeeId], references: [id], onDelete: Cascade) employeeId String @unique - citizenId String? + telephoneNo String? + citizenId String? + fatherBirthPlace String? fatherFirstName String? fatherLastName String? diff --git a/src/controllers/03-employee-other-info-controller.ts b/src/controllers/03-employee-other-info-controller.ts index 49a3150..7d88635 100644 --- a/src/controllers/03-employee-other-info-controller.ts +++ b/src/controllers/03-employee-other-info-controller.ts @@ -34,7 +34,9 @@ function globalAllow(user: RequestWithUser["user"]) { } type EmployeeOtherInfoPayload = { + telephoneNo?: string | null; citizenId?: string | null; + fatherFirstName?: string | null; fatherLastName?: string | null; fatherBirthPlace?: string | null;