history update position

This commit is contained in:
mamoss 2025-08-26 13:47:43 +07:00
parent 0df264e900
commit 910e568973
10 changed files with 625 additions and 16 deletions

View file

@ -5,14 +5,12 @@ import { chunkArray, commandTypePath } from "../interfaces/utils";
import CallAPI from "../interfaces/call-api";
import HttpError from "../interfaces/http-error";
import HttpStatusCode from "../interfaces/http-status";
import { RequestWithUser } from "../middlewares/user";
import { PosMaster } from "../entities/PosMaster";
import { Profile } from "../entities/Profile";
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster";
import { ProfileEmployee } from "../entities/ProfileEmployee";
import { OrgRevision } from "../entities/OrgRevision";
import { request } from "http";
import { EmployeePosition } from "../entities/EmployeePosition";
import { OrgChild1 } from "../entities/OrgChild1";
import { OrgChild2 } from "../entities/OrgChild2";
@ -25,6 +23,7 @@ import { In, Not } from "typeorm";
import { PosMasterAct } from "../entities/PosMasterAct";
import { PermissionOrg } from "../entities/PermissionOrg";
import { sendWebSocket } from "./webSocket";
import { CreatePosMasterHistoryOfficer } from "./PositionService";
export let sendToQueue: (payload: any) => void;
export let sendToQueueOrg: (payload: any) => void;
@ -580,6 +579,7 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise<boolean> {
item.lastUpdateFullName = lastUpdateFullName;
item.lastUpdatedAt = lastUpdatedAt;
await repoPosmaster.save(item).catch((e) => console.log(e));
await CreatePosMasterHistoryOfficer(item.id, null);
}
if (orgRevisionPublish != null && orgRevisionDraft != null) {
//new main revision