-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lbac-2173): dedoublonnage: revue marion (#1845)
* fix(lbac-2173): dedoublonnage: revue marion * fix: rank a chaque passage * fix: update snapshot
- Loading branch information
1 parent
3a01185
commit 9177791
Showing
10 changed files
with
68 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletions
11
server/src/jobs/offrePartenaire/processJobPartnersForApi.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { ObjectId } from "mongodb" | ||
|
||
import { getDbCollection } from "@/common/utils/mongodbUtils" | ||
|
||
import { fillComputedJobsPartners } from "./fillComputedJobsPartners" | ||
import { importFromComputedToJobsPartners } from "./importFromComputedToJobsPartners" | ||
import { jobPartnersByFlux } from "./processJobPartners" | ||
|
||
export const processJobPartnersForApi = async () => { | ||
const filter = { partner_label: { $nin: jobPartnersByFlux } } | ||
|
||
const processId: string = new ObjectId().toString() | ||
await getDbCollection("computed_jobs_partners").updateMany( | ||
{ partner_label: { $nin: jobPartnersByFlux }, currently_processed_id: null }, | ||
{ $set: { currently_processed_id: processId } } | ||
) | ||
const filter = { currently_processed_id: processId } | ||
await fillComputedJobsPartners(filter) | ||
await importFromComputedToJobsPartners(filter) | ||
await getDbCollection("computed_jobs_partners").deleteMany({ $and: [filter, { validated: true }] }) | ||
await getDbCollection("computed_jobs_partners").updateMany(filter, { $set: { currently_processed_id: null } }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { z } from "zod" | ||
|
||
import { zObjectId } from "./common.js" | ||
import recruiterModel from "./recruiter.model.js" | ||
|
||
export const ZComputedJobPartnersDuplicateRef = z.object({ | ||
otherOfferId: zObjectId, | ||
// hardcoded collection names to avoid cyclic dependancies | ||
collectionName: z.enum([recruiterModel.collectionName, "jobs_partners", "computed_jobs_partners"]).describe("nom de la collection contenant l'offre avec _id=otherOfferId"), | ||
reason: z.string(), | ||
}) | ||
|
||
export type IComputedJobPartnersDuplicateRef = z.output<typeof ZComputedJobPartnersDuplicateRef> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters