feat: add employee work fields

This commit is contained in:
Methapon Metanipat 2024-11-11 13:54:47 +07:00
parent 75ecf230f7
commit aae7c4640e
3 changed files with 20 additions and 4 deletions

View file

@ -0,0 +1,18 @@
/*
Warnings:
- You are about to drop the column `remark` on the `EmployeeWork` table. All the data in the column will be lost.
- You are about to drop the column `workEndDate` on the `EmployeeWork` table. All the data in the column will be lost.
- You are about to drop the `EmployeeInCountryNotice` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "EmployeeInCountryNotice" DROP CONSTRAINT "EmployeeInCountryNotice_employeeId_fkey";
-- AlterTable
ALTER TABLE "EmployeeWork" DROP COLUMN "remark",
DROP COLUMN "workEndDate",
ADD COLUMN "identityNo" TEXT;
-- DropTable
DROP TABLE "EmployeeInCountryNotice";

View file

@ -886,11 +886,10 @@ model EmployeeWork {
positionName String? positionName String?
jobType String? jobType String?
workplace String? workplace String?
identityNo String?
workPermitNo String? workPermitNo String?
workPermitIssueDate DateTime? @db.Date workPermitIssueDate DateTime? @db.Date
workPermitExpireDate DateTime? @db.Date workPermitExpireDate DateTime? @db.Date
workEndDate DateTime? @db.Date
remark String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
createdBy User? @relation(name: "EmployeeWorkCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull) createdBy User? @relation(name: "EmployeeWorkCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull)

View file

@ -37,11 +37,10 @@ type EmployeeWorkPayload = {
positionName?: string | null; positionName?: string | null;
jobType?: string | null; jobType?: string | null;
workplace?: string | null; workplace?: string | null;
identityNo?: string | null;
workPermitNo?: string | null; workPermitNo?: string | null;
workPermitIssueDate?: Date | null; workPermitIssueDate?: Date | null;
workPermitExpireDate?: Date | null; workPermitExpireDate?: Date | null;
workEndDate?: Date | null;
remark?: string | null;
}; };
@Route("api/v1/employee/{employeeId}/work") @Route("api/v1/employee/{employeeId}/work")