From fb4732a724ca397141067a9dfeb2b1d45101bb33 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 5 Jun 2024 16:27:26 +0700 Subject: [PATCH] no message --- src/controllers/ProfileEmployeeController.ts | 11 +++++++++++ src/entities/ProfileEmployee.ts | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 626078fc..b13debe4 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -494,6 +494,9 @@ export class ProfileEmployeeController extends Controller { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้"); } + if(body.employeeClass == null || body.employeeClass == undefined || body.employeeClass == ""){ + body.employeeClass = "PERM"; + } if (!["PERM", "TEMP"].includes(body.employeeClass.toLocaleUpperCase())) { throw new HttpError(HttpStatus.NOT_FOUND, "ประเภทลูกจ้างไม่ถูกต้อง"); } @@ -556,6 +559,9 @@ export class ProfileEmployeeController extends Controller { }), ); + if(body.employeeClass == null || body.employeeClass == undefined || body.employeeClass == ""){ + body.employeeClass = "PERM"; + } if (!["PERM", "TEMP"].includes(body.employeeClass.toLocaleUpperCase())) { throw new HttpError(HttpStatus.NOT_FOUND, "ประเภทลูกจ้างไม่ถูกต้อง"); } @@ -779,6 +785,11 @@ export class ProfileEmployeeController extends Controller { position: _data.position, posNo: shortName, employeeClass: _data.employeeClass == null ? null : _data.employeeClass, + dateAppoint: _data.dateAppoint, + dateStart: _data.dateStart, + createdAt: _data.createdAt, + dateRetireLaw: _data.dateRetireLaw, + draftOrgEmployeeStatus: null }; }), ); diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index b1ad91ca..24e557aa 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -488,7 +488,8 @@ export class CreateProfileEmployee { religion?: string | null; bloodGroup?: string | null; phone?: string | null; - employeeClass: string; + salaryLevel?: number | null; + employeeClass?: string | null; } export type UpdateProfileEmployee = { @@ -508,7 +509,8 @@ export type UpdateProfileEmployee = { religion?: string | null; bloodGroup?: string | null; phone?: string | null; - employeeClass: string; + salaryLevel?: number | null; + employeeClass?: string | null; }; export type UpdateProfileAddressEmployee = {