-
Notifications
You must be signed in to change notification settings - Fork 11
Corrige les incohérences de dates et ajoute les dates de publication et de modification de la déclaration #1331
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
base: main
Are you sure you want to change the base?
The head ref may contain hidden characters: "1255-bug-les-dates-affich\u00E9es-dans-la-d\u00E9claration-sont-incoh\u00E9rentes-ou-absentes"
Conversation
| const audit = await this.prisma.audit.findUnique({ | ||
| where: { editUniqueId: uniqueId } | ||
| }); |
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 besoin de fetcher tout l’objet
| const audit = await this.prisma.audit.findUnique({ | |
| where: { editUniqueId: uniqueId } | |
| }); | |
| const audit = await this.prisma.audit.findUnique({ | |
| where: { editUniqueId: uniqueId }, | |
| select: { statementPublicationDate: true } | |
| }); |
| where: { editUniqueId: uniqueId } | ||
| }); | ||
|
|
||
| return this.prisma.audit.updateMany({ |
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 peut utiliser prisma.audit.update() ici je pense.
| where: { editUniqueId: uniqueId } | ||
| }); | ||
|
|
||
| return this.prisma.audit.updateMany({ |
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.
updateStatementDate n’utilise la valeur retournée.
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.
Effectivement...
| this.updateStatementDate(uniqueId); | ||
| } | ||
|
|
||
| return audit; |
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.
Tu peux voir comment j’ai fait sur la PR de la mise à jour de la date ici
Ara/confiture-rest-api/src/audits/audit.service.ts
Lines 369 to 371 in 325f809
| if (!changedProperties.every(changedProperty => ignoredChanges.includes(changedProperty))) { | |
| return (await this.updateAuditEditDate(uniqueId)) ?? audit; | |
| } |
| {{ formatDate(auditStore.currentAudit?.publicationDate) }} | ||
| </time> | ||
| </strong> | ||
| <span v-if="auditStore.currentAudit?.editionDate && !isSameDay(auditStore.currentAudit?.publicationDate, auditStore.currentAudit?.editionDate)" class="fr-text--xs fr-mb-0 audit-status-modify"> |
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 avait pas fait un truc pour avoir max 1 attribut par ligne ?
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.
Si... Je viens de l'aider en mettant un attribut à la ligne et il m'a mis l'autre sur une autre ligne en sauvegardant le fichier. Meh.
| <template v-if="report.data.updateDate">Elle a été mise à jour le | ||
| <strong>{{ formatDate(report.data.updateDate) }}</strong>.</template> | ||
| <p class="fr-mb-2w fr-mb-md-3w"> | ||
| Cette déclaration a été établie le {{ report.data.statementPublicationDate ? formatDate(report.data.statementPublicationDate) : '[JJ/MM/YYYY]' }}. |
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 normal le [JJ/MM/YYYY] ?
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 !
Suite à tests du 15/12/2025Retours
Remarques et cas particuliers
--> À revoir :
|
… publication date
…it, statement, report)
2558d1b to
e7f6aae
Compare
Migration audits existantsPas besoin finalement (on affiche pas la date si on a pas la date de rédaction de la déclarationcloses #1255