Merge branch 'adiDev' into develop

This commit is contained in:
AdisakKanthawilang 2024-02-16 14:09:57 +07:00
commit 042c212cf6
2 changed files with 24 additions and 9 deletions

View file

@ -342,7 +342,10 @@ export class Salary extends Controller {
// *
// */
// @Post("copy")
// async copySalary(@Body() body: { id: string }) {
// async copySalary(
// @Body() body: { id: string },
// @Request() request: { user: Record<string, any> }
// ) {
// const salary = await this.salaryRepository.findOne({
// relations: ["posLevel_", "posType_", "salaryRanks_"],
// where:{id:body.id}
@ -362,18 +365,30 @@ export class Salary extends Controller {
// newSalary.salaryType = salary.salaryType;
// newSalary.posTypeId = salary.posTypeId
// newSalary.posLevelId = salary.posLevelId
// newSalary.createdUserId = request.user.sub,
// newSalary.createdFullName = request.user.name,
// newSalary.createdAt = new Date(),
// newSalary.lastUpdateUserId = request.user.sub,
// newSalary.lastUpdateFullName = request.user.name,
// newSalary.lastUpdatedAt = new Date(),
// await this.salaryRepository.save(newSalary);
// const newRanks = salary.salaryRanks_.map((rank) => {
// const newRank = this.salaryRankRepository.create({
// ...rank, // เก็บทุก property จาก rank
// salaryId: newSalary.id,
// newRanks.forEach(async (x: any) => {
// var dataId = x.id;
// delete x.id;
// const data = Object.assign(new SalaryRanks(), x);
// data.salaryId = newSalary.id,
// data.createdUserId = request.user.sub,
// data.createdFullName = request.user.name,
// data.createdAt = new Date(),
// data.lastUpdateUserId = request.user.sub,
// data.lastUpdateFullName = request.user.name,
// data.lastUpdatedAt = new Date(),
// await this.salaryRankRepository.save(data);
// });
// return newRank;
// });
// await this.salaryRankRepository.save(newRanks);
// return new HttpSuccess({ id: newSalary.id });
// } catch (error) {
// return error;

View file

@ -97,7 +97,7 @@ export class CreateSalary {
endDate?: Date;
@Column()
detail?: string;
details?: string;
}