แก้ไขข้อมูลราชการเเละบันทึกไม่ได้รับเงินเดือนเพิ่มเติม

This commit is contained in:
AnandaTon 2024-05-13 17:26:04 +07:00
parent f42f200c8a
commit 1afe64bdd3
8 changed files with 60 additions and 16 deletions

View file

@ -19,7 +19,7 @@ import HttpError from "../interfaces/http-error";
import { ProfileDisciplineHistory } from "../entities/ProfileDisciplineHistory"; import { ProfileDisciplineHistory } from "../entities/ProfileDisciplineHistory";
import { RequestWithUser } from "../middlewares/user"; import { RequestWithUser } from "../middlewares/user";
import { import {
CreateProfileDiscipline, CreateProfileEmployeeDiscipline,
ProfileDiscipline, ProfileDiscipline,
UpdateProfileDiscipline, UpdateProfileDiscipline,
} from "../entities/ProfileDiscipline"; } from "../entities/ProfileDiscipline";
@ -114,7 +114,7 @@ export class ProfileDisciplineEmployeeController extends Controller {
@Post() @Post()
public async newDiscipline( public async newDiscipline(
@Request() req: RequestWithUser, @Request() req: RequestWithUser,
@Body() body: CreateProfileDiscipline, @Body() body: CreateProfileEmployeeDiscipline,
) { ) {
if (!body.profileEmployeeId) { if (!body.profileEmployeeId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId"); throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");

View file

@ -19,7 +19,7 @@ import HttpError from "../interfaces/http-error";
import { ProfileDutyHistory } from "../entities/ProfileDutyHistory"; import { ProfileDutyHistory } from "../entities/ProfileDutyHistory";
import { RequestWithUser } from "../middlewares/user"; import { RequestWithUser } from "../middlewares/user";
import { ProfileEmployee } from "../entities/ProfileEmployee"; import { ProfileEmployee } from "../entities/ProfileEmployee";
import { CreateProfileDuty, ProfileDuty, UpdateProfileDuty } from "../entities/ProfileDuty"; import { CreateProfileEmployeeDuty, ProfileDuty, UpdateProfileDuty } from "../entities/ProfileDuty";
@Route("api/v1/org/profile/duty") @Route("api/v1/org/profile/duty")
@Tags("ProfileDuty") @Tags("ProfileDuty")
@ -106,7 +106,7 @@ export class ProfileDutyController extends Controller {
} }
@Post() @Post()
public async newDuty(@Request() req: RequestWithUser, @Body() body: CreateProfileDuty) { public async newDuty(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeDuty) {
if (!body.profileEmployeeId) { if (!body.profileEmployeeId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId"); throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
} }

View file

@ -15,7 +15,7 @@ import {
import { AppDataSource } from "../database/data-source"; import { AppDataSource } from "../database/data-source";
import { import {
ProfileLeaveHistory, ProfileLeaveHistory,
CreateProfileLeave, CreateProfileEmployeeLeave,
ProfileLeave, ProfileLeave,
UpdateProfileLeave, UpdateProfileLeave,
} from "../entities/ProfileLeave"; } from "../entities/ProfileLeave";
@ -157,7 +157,7 @@ export class ProfileLeaveController extends Controller {
} }
@Post() @Post()
public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileLeave) { public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeLeave) {
if (!body.profileEmployeeId) { if (!body.profileEmployeeId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId"); throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
} }

View file

@ -19,7 +19,11 @@ import HttpError from "../interfaces/http-error";
import { ProfileNopaidHistory } from "../entities/ProfileNopaidHistory"; import { ProfileNopaidHistory } from "../entities/ProfileNopaidHistory";
import { RequestWithUser } from "../middlewares/user"; import { RequestWithUser } from "../middlewares/user";
import { ProfileEmployee } from "../entities/ProfileEmployee"; import { ProfileEmployee } from "../entities/ProfileEmployee";
import { CreateProfileNopaid, ProfileNopaid, UpdateProfileNopaid } from "../entities/ProfileNopaid"; import {
CreateProfileEmployeeNopaid,
ProfileNopaid,
UpdateProfileNopaid,
} from "../entities/ProfileNopaid";
@Route("api/v1/org/profile/nopaid") @Route("api/v1/org/profile/nopaid")
@Tags("ProfileNopaid") @Tags("ProfileNopaid")
@ -83,7 +87,10 @@ export class ProfileNopaidController extends Controller {
} }
@Post() @Post()
public async newNopaid(@Request() req: RequestWithUser, @Body() body: CreateProfileNopaid) { public async newNopaid(
@Request() req: RequestWithUser,
@Body() body: CreateProfileEmployeeNopaid,
) {
if (!body.profileEmployeeId) { if (!body.profileEmployeeId) {
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId"); throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
} }

View file

@ -86,8 +86,17 @@ export class ProfileDiscipline extends EntityBase {
export class CreateProfileDiscipline { export class CreateProfileDiscipline {
date: Date | null; date: Date | null;
profileId?: string; profileId: string;
profileEmployeeId?: string | null; level: string | null;
detail: string | null;
refCommandDate: Date | null;
refCommandNo: string | null;
unStigma: string | null;
}
export class CreateProfileEmployeeDiscipline {
date: Date | null;
profileEmployeeId: string | null;
level: string | null; level: string | null;
detail: string | null; detail: string | null;
refCommandDate: Date | null; refCommandDate: Date | null;

View file

@ -83,8 +83,17 @@ export class ProfileDuty extends EntityBase {
} }
export class CreateProfileDuty { export class CreateProfileDuty {
profileId?: string | null; profileId: string | null;
profileEmployeeId?: string | null; dateStart: Date | null;
dateEnd: Date | null;
detail: string | null;
reference: string | null;
refCommandDate: Date | null;
refCommandNo: string | null;
}
export class CreateProfileEmployeeDuty {
profileEmployeeId: string | null;
dateStart: Date | null; dateStart: Date | null;
dateEnd: Date | null; dateEnd: Date | null;
detail: string | null; detail: string | null;

View file

@ -115,9 +115,20 @@ export class ProfileLeaveHistory extends ProfileLeave {
} }
export class CreateProfileLeave { export class CreateProfileLeave {
profileId?: string | null; profileId: string | null;
leaveTypeId: string; leaveTypeId: string;
profileEmployeeId?: string | null; dateLeaveStart: Date | null;
dateLeaveEnd: Date | null;
leaveDays: number | null;
leaveCount: number | null;
totalLeave: number | null;
status: string | null;
reason: string | null;
}
export class CreateProfileEmployeeLeave {
leaveTypeId: string;
profileEmployeeId: string | null;
dateLeaveStart: Date | null; dateLeaveStart: Date | null;
dateLeaveEnd: Date | null; dateLeaveEnd: Date | null;
leaveDays: number | null; leaveDays: number | null;

View file

@ -75,8 +75,16 @@ export class ProfileNopaid extends EntityBase {
} }
export class CreateProfileNopaid { export class CreateProfileNopaid {
profileId?: string | null; profileId: string | null;
profileEmployeeId?: string | null; date: Date | null;
detail: string | null;
reference: string | null;
refCommandDate: Date | null;
refCommandNo: string | null;
}
export class CreateProfileEmployeeNopaid {
profileEmployeeId: string | null;
date: Date | null; date: Date | null;
detail: string | null; detail: string | null;
reference: string | null; reference: string | null;