mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-10 23:12:53 +08:00
WIP: add the logic to save job mark as not suit to db TODO: fix issue about retrieving and showing items
This commit is contained in:
@@ -8,6 +8,7 @@ import { ChatStartupLog } from "./entity/ChatStartupLog";
|
||||
import { BossInfoChangeLog } from "./entity/BossInfoChangeLog";
|
||||
import { CompanyInfoChangeLog } from "./entity/CompanyInfoChangeLog";
|
||||
import { JobInfoChangeLog } from "./entity/JobInfoChangeLog";
|
||||
import { MarkAsNotSuitLog } from "./entity/MarkAsNotSuitLog";
|
||||
|
||||
function getBossInfoIfIsEqual (savedOne, currentOne) {
|
||||
if (savedOne === currentOne) {
|
||||
@@ -262,3 +263,30 @@ export async function saveChatStartupRecord(
|
||||
//#endregion
|
||||
return
|
||||
}
|
||||
|
||||
export async function saveMarkAsNotSuitRecord(
|
||||
ds: DataSource,
|
||||
_jobInfo,
|
||||
{ encryptUserId },
|
||||
{ autoStartupChatRecordId = undefined, markFrom = undefined, extInfo = undefined, markReason = undefined } = {}
|
||||
) {
|
||||
const { jobInfo } = _jobInfo;
|
||||
|
||||
//#region mark-as-not-suit-log
|
||||
const markAsNotSuitLog = new MarkAsNotSuitLog()
|
||||
const markAsNotSuitLogPayload: Partial<MarkAsNotSuitLog> = {
|
||||
date: new Date(),
|
||||
encryptCurrentUserId: encryptUserId,
|
||||
encryptJobId: jobInfo.encryptId,
|
||||
autoStartupChatRecordId,
|
||||
markFrom,
|
||||
markReason,
|
||||
extInfo: extInfo ? JSON.stringify(extInfo) : undefined
|
||||
}
|
||||
Object.assign(markAsNotSuitLog, markAsNotSuitLogPayload)
|
||||
|
||||
const markAsNotSuitLogRepository = ds.getRepository(MarkAsNotSuitLog);
|
||||
await markAsNotSuitLogRepository.save(markAsNotSuitLog);
|
||||
//#endregion
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user