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 = {