Build and send pre-processing reports #92
Draft
+144
−52
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.
Context
Our back-end system is composed of several components :
Pre-processing component (id-fix)
Processing component (ban-plateforme)
Our logs are separated and also are only written on server files.
Our system need to have a better visibility on the pre-processing and processing logs of the BAL sent to the BAN.
Enhancement
This PR aims to :
How to test
Need to start ban-plateforme and id-fix, connected locally.
Here is the corresponding ban-plateforme PR : BaseAdresseNationale/ban-plateforme#433
I. Legacy pre-processing report :
*revisionData being the data from the last revision of api-de-dépôt.
II. Pre-processing reports - Success:
/address
/common-toponym
)*revisionData being the data from the last revision of api-de-dépôt.
This pre-processing report contains a pre-processing response with the different status ID from our asynchronous ban apis. This pre-processing report can be "rebuilt" in a final state by two mechanisms :
api/report/district/{districtID}
(or/api/report/district/cog/{cog}
)In worker.js file, change 1d to 10s for example :
queue('build-reports').add({}, {jobId: 'buildReportsJobId', repeat: {every: ms('10s')}, removeOnComplete: true})
III. Pre-processing reports - Error:
The pre-processing report can also sent pre-processing errors such as :
To test this behaviour :
*revisionData being the data from the last revision of api-de-dépôt.