[TECH] Créer un script permettant l'ajout des ids de contenus formatifs pour la mise en avant en fin de parcours (PIX-24009). - #17410
Open
AndreiaPena wants to merge 1 commit into
Conversation
|
Choisir les applications à déployer :
Important N'oubliez pas de déployer l'API pour pouvoir accéder aux fronts et/ou à l’API MaDDo. |
Co-authored-by: Claude <noreply@anthropic.com>
AndreiaPena
force-pushed
the
PIX-24009-create-script-to-set-highlighted-training-ids-on-campaign-with-recommendation-feature-enabled
branch
from
September 7, 2026 13:51
506d29e to
be6bad1
Compare
dianeCdrPix
reviewed
Sep 8, 2026
| const foundTrainingIds = foundTrainings.map(({ id }) => id); | ||
| const missingTrainingIds = highlightedTrainingIds.filter((trainingId) => !foundTrainingIds.includes(trainingId)); | ||
| if (missingTrainingIds.length > 0) { | ||
| throw new Error(`Training(s) not found in "trainings" table: ${missingTrainingIds.join(', ')}`); |
Contributor
There was a problem hiding this comment.
question: c'est la liste des CF mis en avant manquant, ou des CF en général manquant ?
| dryRun: { | ||
| type: 'boolean', | ||
| describe: 'Run the script without making any database changes', | ||
| default: false, |
Contributor
There was a problem hiding this comment.
suggestion: le mettre à true par defaut
dianeCdrPix
reviewed
Sep 8, 2026
| }); | ||
| }); | ||
|
|
||
| context('when the campaign has the feature enabled and all training ids exist', function () { |
Contributor
There was a problem hiding this comment.
Suggested change
| context('when the campaign has the feature enabled and all training ids exist', function () { | |
| context('when the campaign has the recommandation engine feature enabled, and all provided training ids exist', function () { |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
☀️ Problème
Nous avons mis en place la mise en avant dans la page de fin de parcours.
On veut pouvoir permettre au métier de mettre à jours les ids des contenus formatifs (ceux qui seront mis en avant dans la page) pour les campagnes qui bénéficient du moteur de reco.
⛱️ Proposition
Créer un script pour cette mise à jour. Ce script fonctionne en ajoutant les entrées directement dans la ligne de commande.
🏊 Pour tester
Lancer la commande de script
Cas où le script jette une erreur :
campaignId)campaignIdqui n'existe pascampaignIdqui existe (5000), mais pas danscampaign-featurescampaignIdqui existe danscampaign-features(112545), mais pas lié àRECOMMENDATION_ENGINE(1012)campaignIdqui existe danscampaign-features(1000000), lié àRECOMMENDATION_ENGINE(1012) mas letrainingIdrenseigné n'existe pasCas passant en dryRun
campaignId=1000000/highlightedTrainingIds=8001=> voir les logs d'info de la prise en compte du
trainingId8001dans lacampaignId1000000ET avec le messageROLLBACK: no changes were persisted (dry run)Lancer en vrai et avoir
Tester avec plusieurs ids...