Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lbac-2409): migration recruteurslba to jobs_partners #1785

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

kevbarns
Copy link
Collaborator

@kevbarns kevbarns commented Jan 22, 2025

  • refactoring de l'import des sociétés issue de algo lba
  • migration de la collection recruteurslba vers jobs_partners

https://tableaudebord-apprentissage.atlassian.net/browse/LBA-2409

@kevbarns kevbarns self-assigned this Jan 22, 2025
Copy link

To deploy this PR just add a comment with a simple 🚀

@kevbarns kevbarns marked this pull request as ready for review February 13, 2025 14:03
@kevbarns kevbarns requested a review from a team as a code owner February 13, 2025 14:03
@kevbarns kevbarns changed the title feat(lbac-2409): control algo companies email feat(lbac-2409): migration recruteurslba to jobs_partners Feb 13, 2025

if (!lbaCompaniesToUnsubscribe.length) {
result = { result: UNSUBSCRIBE_EMAIL_ERRORS.NON_RECONNU }
} else if (lbaCompaniesToUnsubscribe.length > 1 && !sirets) {
const companies = lbaCompaniesToUnsubscribe.map((company) => {
return { enseigne: company.enseigne, siret: company.siret, address: buildLbaCompanyAddress(company) }
return { enseigne: company.workplace_legal_name!, siret: company.workplace_siret!, address: company.workplace_address_label }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return { enseigne: company.workplace_legal_name!, siret: company.workplace_siret!, address: company.workplace_address_label }
return { enseigne: company.workplace_legal_name, siret: company.workplace_siret, address: company.workplace_address_label }

Ca me paraît dangereux

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remy-auricoste c'est systématiquement valorisé pour les recruteurs_lba d'après la raw_recruteurslba. je peux modifier le modèle attendu en sortie sinon de la route.

unsubscribe_reason: reason,
unsubscribe_date: now,
}

await getDbCollection("unsubscribedrecruteurslba").insertOne(unsubscribedLbaCompany)

const lbaCompanyToUnsubscribe = await getDbCollection("recruteurslba").findOne({ siret })
const lbaCompanyToUnsubscribe = await getDbCollection("jobs_partners").findOne({ workplace_siret })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ca ne garantit pas qu'il s'agit d'un recruteur lba. Ca pourrait être une offre de la même entreprise venant d ailleurs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes j'ai update la query

projection: { _id: 0, email: 0, phone: 0, geopoint: 0, recruitment_potential: 0, opco_short_name: 0 },
collection: "jobs_partners",
query: { partner_label: JOBPARTNERS_LABEL.RECRUTEURS_LBA },
projection: { _id: 0, apply_email: 0, apply_phone: 0, workplace_geopoint: 0, workplace_opco: 0, workplace_idcc: 0 },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il faut probablement aussi enlever les champs techniques. Je pense qu'il faut plutôt passer à une white liste se basant sur le zod du endpoint de lecture publique

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -183,7 +183,7 @@ const ZNewApplicationTransitionToV2 = ZApplicationOld.extend({
// KBA 20241011 to remove once V2 is LIVE and V1 support has ended
export type INewApplicationV1 = z.output<typeof ZNewApplicationTransitionToV2>

export const ZJobCollectionName = z.enum(["recruteurslba", "partners", "recruiters"])
export const ZJobCollectionName = z.enum(["partners", "recruiters"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ca implique de faire une migration

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remy-auricoste A quel niveau ?

return LBA_ITEM_TYPE.RECRUTEURS_LBA

case "offres":
case "offres": // compatibility V1 to retreive FT jobs
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanlr tu confirmes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants