status ช่วยราชการ

This commit is contained in:
mamoss 2025-04-01 11:14:42 +07:00
parent 00fbe53f17
commit 72bd27c9b0
3 changed files with 1268 additions and 0 deletions

View file

@ -198,4 +198,23 @@ export class ProfileAssistanceController extends Controller {
return new HttpSuccess();
}
@Post("status")
public async editStatusProfileAssistance(
@Body() body: { status: string; refId: string },
@Request() req: RequestWithUser,
@Path() assistanceId: string,
) {
const record = await this.profileAssistanceRepo.findOneBy({ refId: body.refId });
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
record.status = body.status.trim().toLocaleUpperCase();
record.lastUpdateUserId = req.user.sub;
record.lastUpdateFullName = req.user.name;
record.lastUpdatedAt = new Date();
this.profileAssistanceRepo.save(record);
return new HttpSuccess();
}
}

View file

@ -15,6 +15,13 @@ export class ProfileAssistance extends EntityBase {
})
profileId: string;
@Column({
comment: "สถานะ",
default: "PENDING",
length: 20,
})
status: string;
@Column({
nullable: true,
comment: "หน่วยงานที่ให้ช่วยราชการ",

File diff suppressed because one or more lines are too long