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

fix: siret_valid = true while siret is not valid #1234

Merged

Conversation

sbenfares
Copy link
Contributor

No description provided.

@@ -92,6 +92,11 @@ const updateDossierApprenant = async (existingItemId, toUpdate) => {
);
const existingItem = await DossierApprenantModel.findById(existingItemId);

// handle siret update & siret_etablissement_valid update value
Copy link
Contributor

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);
Copy link
Contributor

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 ?

Copy link
Contributor Author

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", {
Copy link
Contributor

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

Copy link
Contributor Author

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

@sbenfares sbenfares force-pushed the feature/fix-update-dossiersApprenants-siret-valid-update branch from 00518a1 to 544c494 Compare June 1, 2022 15:25
@sbenfares sbenfares merged this pull request into develop Jun 1, 2022
@sbenfares sbenfares deleted the feature/fix-update-dossiersApprenants-siret-valid-update branch June 1, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants