fix(indemnite-licenciement): retirer la question sur la date de sortie pour la 3239#7236
fix(indemnite-licenciement): retirer la question sur la date de sortie pour la 3239#7236
Conversation
revu-bot
left a comment
There was a problem hiding this comment.
PR Summary: Hide dateSortie field for CC 3239
This PR correctly removes the "date de fin du préavis" question for the CC 3239 (particuliers employeurs) collective agreement, as per issue #7235. The approach is sound: a new shouldShowDateSortie utility function gates the UI field, and the store automatically mirrors dateSortie from dateNotification when the field is hidden to keep the calculation engine in a consistent state.
Overall Assessment
The implementation is clean and well-scoped. A few issues worth addressing:
| File | Lines | Severity | Issue |
|---|---|---|---|
store.ts |
56–62 | IMPORTANT | updateAncienneteEstimee called twice when dateSortie is hidden |
question.ts |
107–110 | IMPORTANT | shouldShowDateSortie lacks a docstring per coding guidelines |
store.ts |
56–62 | IMPORTANT | dateSortie is not synced on dateEntree change, leaving stale state |
| export const shouldShowDateSortie = (agreement?: Agreement): boolean => { | ||
| // Pour la CC 3239 (particuliers employeurs), seule la date de notification compte : la date de fin du préavis n'est pas demandée à l'utilisateur. | ||
| return agreement?.num !== 3239; | ||
| }; |
There was a problem hiding this comment.
[IMPORTANT] Public function missing docstring (coding guidelines violation)
Per the coding guidelines, public functions must have concise docstrings explaining purpose and return values. shouldShowDateSortie is exported and used in two different modules, so it qualifies.
The inline comment explains the CC 3239 rationale but is not a docstring — it describes the why of the business rule rather than the function's contract.
| export const shouldShowDateSortie = (agreement?: Agreement): boolean => { | |
| // Pour la CC 3239 (particuliers employeurs), seule la date de notification compte : la date de fin du préavis n'est pas demandée à l'utilisateur. | |
| return agreement?.num !== 3239; | |
| }; | |
| /** | |
| * Determines whether the "date de fin du préavis" (dateSortie) field should be | |
| * displayed to the user. | |
| * | |
| * For CC 3239 (particuliers employeurs), only the notification date matters; | |
| * the end-of-notice date is not collected from the user. | |
| * | |
| * @param agreement - The currently selected collective agreement, if any. | |
| * @returns `true` when the dateSortie field should be shown, `false` otherwise. | |
| */ | |
| export const shouldShowDateSortie = (agreement?: Agreement): boolean => { | |
| return agreement?.num !== 3239; | |
| }; |
|
|
🎉 Deployment for commit 59a3f94 : Docker images
|



fix #7235