-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: siret_valid = true while siret is not valid #1234
fix: siret_valid = true while siret is not valid #1234
Conversation
@@ -92,6 +92,11 @@ const updateDossierApprenant = async (existingItemId, toUpdate) => { | |||
); | |||
const existingItem = await DossierApprenantModel.findById(existingItemId); | |||
|
|||
// handle siret update & siret_etablissement_valid update value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On accepte explicitement l'update de SIRET donc (plutôt logique vu que le champ n'est pas obligatoire et pas dans la clé d'unicité)
|
||
// Search for invalid siret while valid field true | ||
if (!validateSiret(currentSiretValid)) { | ||
logger.info(currentSiretValid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pas forcément utile de log le SIRET ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah oui c t un reliquat de debug je pense 🤣
logger.info("Run DossierApprenant - Fix SIRET invalid Job"); | ||
|
||
// Retrieve all distinct siret valid | ||
const distinctSiretValidFromDossierApprenants = await DossierApprenantModel.distinct("siret_etablissement", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On passe à côté des éventuels SIRET qui étaient invalides (car non fournis) mais qui le sont depuis suite à un update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui bien vu je vais modif le script pour gérer ces cas
00518a1
to
544c494
Compare
No description provided.