feat : notification de fin de contrat (veille ouvrée du dernier jour) #35
Reference in New Issue
Block a user
Delete Branch "feature/SIRH-43-ajouter-une-notif-la-veille-d-un-contrat-qui-se-te"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Objectif
Prévenir automatiquement les administrateurs, sur le dernier jour ouvré précédant la fin d'un contrat, qu'un salarié arrive au terme de son emploi.
Fonctionnement
app:contract:end-notifications(à brancher sur le crontab prod, ~6h ; option--date=YYYY-MM-DDpour test/rattrapage).endDate(inclusif). Week-ends et fériés sautés → une fin de contrat le lundi est signalée dès le vendredi. Le Lundi de Pentecôte reste un jour ouvré (cohérent avec le reste de l'app).Contrat, lien/employees/{id}, sans acteur.(recipient, category, target, message).notifications).Architecture
Logique pure isolée et testée :
WorkingDayCalculator(week-end + férié) +ContractEndNotificationPlanner(fenêtre + message). Persistance dansContractEndNotificationService, exposée parContractEndNotificationCommand. Méthodes repofindLatestPeriodsForAllEmployees+existsForRecipientCategoryTargetMessage.Tests & vérification
Documentation
doc/contract-end-notifications.md,doc/functional-rules.md(§15), doc in-app (documentation-content.ts),CLAUDE.md.⚠️ Tâche infra
Ajouter la ligne crontab prod :
0 6 * * * … bin/console app:contract:end-notifications🤖 Generated with Claude Code