Skip to content

Fiches salarié: Amélioration de l'affichage des horodatages#6768

Merged
tonial merged 3 commits into
masterfrom
alaurent/employee_record_summary_notifications_order
Sep 4, 2025
Merged

Fiches salarié: Amélioration de l'affichage des horodatages#6768
tonial merged 3 commits into
masterfrom
alaurent/employee_record_summary_notifications_order

Conversation

@tonial

@tonial tonial commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Pour simplifier les échanges entre l'ASP et les SIAEs

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?
  • Ajouter l'étiquette « Bug » ?

🏝️ Comment tester ?

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

@tonial tonial added the modifié Modifié dans le changelog. label Sep 2, 2025
@tonial tonial self-assigned this Sep 2, 2025
@tonial tonial requested a review from rsebille September 2, 2025 04:55
@tonial tonial force-pushed the alaurent/employee_record_summary_notifications_order branch 2 times, most recently from 8cc8f45 to 5c842e3 Compare September 2, 2025 19:22
Comment thread itou/www/employee_record_views/views.py Outdated


def get_asp_batch_file_timestamp(asp_batch_file):
return datetime.strptime(asp_batch_file[8:22], "%Y%m%d%H%M%S")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vu qu'on utilise le pattern aussi à d'autre endroit, peut-être en faire une constante dans EmployeeRecordBatch ?
Je pense même que la fonction actuelle pourrais être mise là bas car la classe contient déjà les fonctions utilitaires pour le nom de fichier et mon spider sense me dit qu'on va assez vite vouloir la réutiliser pour faire la même chose dans l'admin 😁.

@tonial tonial Sep 4, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai aussi ajouté 2 helpers pour créer le nom de fichier et lire la date.
Et j'ai modifié 2 staticmethod qui accèdent à des constants de la class en classmethod

Comment thread itou/www/employee_record_views/views.py Outdated

creations = [
("Mouvement de création", asp_batch_file, get_asp_batch_file_timestamp(asp_batch_file))
for asp_batch_file in employee_record.logs.filter(asp_batch_file__isnull=False).values_list(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici ça me semble préférable de filtrer sur la transition qui correspond à l'envoi que sur la présence du fichier, notre discussion d'hier à relancer mon intuition qu'on devrais sans doute avoir le nom du fichier retour dans les transitions vers l'état retourné par l'ASP (REJECT et PROCESS)

Suggested change
for asp_batch_file in employee_record.logs.filter(asp_batch_file__isnull=False).values_list(
for asp_batch_file in employee_record.logs.filter(transition=EmployeeRecordTransition.WAIT_FOR_ASP_RESPONSE).values_list(

Comment thread itou/www/employee_record_views/views.py Outdated
]
changes = [
("Mouvement de modification", asp_batch_file, get_asp_batch_file_timestamp(asp_batch_file))
for asp_batch_file in employee_record.update_notifications.values_list("asp_batch_file", flat=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les NEW n'ont pas encore été envoyées donc on ne veux pas les afficher, et elles n'auront pas de fichier dans tout les cas :

Suggested change
for asp_batch_file in employee_record.update_notifications.values_list("asp_batch_file", flat=True)
for asp_batch_file in employee_record.update_notifications.exclude(status=Status.NEW).values_list("asp_batch_file", flat=True)

@tonial tonial force-pushed the alaurent/employee_record_summary_notifications_order branch from 5c842e3 to a3519c1 Compare September 4, 2025 04:56
@tonial tonial requested a review from rsebille September 4, 2025 04:56
@tonial tonial force-pushed the alaurent/employee_record_summary_notifications_order branch 2 times, most recently from c2b121c to 37ac813 Compare September 4, 2025 07:09
@tonial tonial force-pushed the alaurent/employee_record_summary_notifications_order branch from 37ac813 to 19ce58b Compare September 4, 2025 07:12

@rsebille rsebille left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien vu pour la TZ !

@tonial tonial added this pull request to the merge queue Sep 4, 2025
Merged via the queue into master with commit dfe3a2c Sep 4, 2025
14 checks passed
@tonial tonial deleted the alaurent/employee_record_summary_notifications_order branch September 4, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants