-
Notifications
You must be signed in to change notification settings - Fork 2
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/updateRoute #90
Fix/updateRoute #90
Conversation
packages/courDeCassation/README.md
Outdated
@@ -119,7 +119,7 @@ prod label script exportSpecificDocument --documentNumber=10000 --source=jurinet | |||
|
|||
In Wallix, with a Cygwin terminal: | |||
``` | |||
prod label script updateRoute --status=free | |||
prod label script updateRouteForFreeDocuments --status=free |
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.
A l'occasion il faudra qu'on mette a jour/supprime ce readme qui n'est plus a jour 😆
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 que le readme @ajeanneney
@@ -27,6 +28,10 @@ function extractRoute( | |||
switch (source) { | |||
case 'jurinet': | |||
try { | |||
logger.error({ |
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.
logger.error({ | |
logger.log({ |
c'est pas encore une erreur a ce niveau la ;)
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.
C'est un logger qui doit être supprimer, j'ai du l'oublier
@@ -27,6 +28,10 @@ function extractRoute( | |||
switch (source) { | |||
case 'jurinet': | |||
try { | |||
logger.error({ | |||
operationName: 'extractRouteForJurinet', | |||
msg: `${routeInfos}`, |
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.
"extractRouteForJurinet","msg":"[object Object]"
ça log ça ducoup :/
docker container exec -it label_backend_1 sh -c "cd packages/courDeCassation; sh scripts/runLocalScript.sh ./dist/scripts/updateRoute.js"
pour tester en local 😉
Et enfait mieux vaut ne pas logger les routeInfos
, il y a les parties dedans (données sensibles)
packages/courDeCassation/README.md
Outdated
@@ -119,7 +119,7 @@ prod label script exportSpecificDocument --documentNumber=10000 --source=jurinet | |||
|
|||
In Wallix, with a Cygwin terminal: | |||
``` | |||
prod label script updateRoute --status=free | |||
prod label script updateRouteForFreeDocuments --status=free |
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.
prod label script updateRouteForFreeDocuments --status=free | |
prod label script updateRouteForFreeDocuments |
}); | ||
const { environment, settings } = await parametersHandler.getParameters(); | ||
prompt.question( | ||
'Confirmez vous le lancement de ce script (yes/no)? ', |
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.
'Confirmez vous le lancement de ce script (yes/no)? ', | |
'Voulez vous mettre a jour le circuit de relecture de tous les documents free (yes/no)? ', |
Sinon bien vu le message de confirmation 🆗
@@ -59,20 +73,3 @@ async function updateRoute(status: documentType['status']) { | |||
); |
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.
); | |
); | |
if(newRoute === 'automatic'){ | |
documentRepository.updateStatusById(documentsToUpdate[index]._id, "done"); | |
} |
Je pense que c'est mieux de mettre la logique ici :
- ça évite d'avoir de la logique dans le repository
- a cette endroit on est sur que le document est en status
free
car c'est défini en dur dans le code, le risque selon moi de le mettre dans le repository est que leupdateStatusById
soit appelé dans un autre contexte qui peut poser problème. Si un jour on appelleupdateRouteById
sur un documentloaded
et que sa nouvelle route est automatique alors il passe a done alors qu'il n'est pas annoté par le moteur
@@ -216,6 +216,9 @@ const buildDocumentRepository = buildRepositoryBuilder< | |||
async updateRouteById(_id, route) { | |||
await collection.updateOne({ _id }, { $set: { route } }); | |||
const updatedDocument = await collection.findOne({ _id }); | |||
if (updatedDocument?.route == 'automatic') { |
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.
je préfère qu'on ne mette pas la logique dans le repository, cf. commentaire plus haut
* Feature/appeal number 399 (#82) * adding regex to get registreNUmber || pourvoie * adding logique to extract RG or Appeal or NumeroRoleGeneral for title in label * renaming and resolving bug * renaming and resolving bug * rename and lint * optimisation of code * little clean * updating sder commit --------- Co-authored-by: Antoine Jeanneney <[email protected]> * Fix/updateRoute (#90) * updating status to done for automatic route decisions * updating readme * updating antoine's request --------- Co-authored-by: Antoine Jeanneney <[email protected]>
* updating status to done for automatic route decisions * updating readme * updating antoine's request
Issue description :
Describe your changes :
if (updatedDocument?.route == 'automatic') { await this.updateStatusById(_id, 'done'); }
How to test :
Make some changes in your storage folder, put an automatic code => in documents
"NACCode": "11A", "NPCode": "11A", "endCaseCode": "11A",
Checklist before requesting a review