Skip to content

fix(indemnite-licenciement): retirer la question sur la date de sortie pour la 3239#7236

Open
maxgfr wants to merge 1 commit intodevfrom
maxgfr/wording
Open

fix(indemnite-licenciement): retirer la question sur la date de sortie pour la 3239#7236
maxgfr wants to merge 1 commit intodevfrom
maxgfr/wording

Conversation

@maxgfr
Copy link
Copy Markdown
Member

@maxgfr maxgfr commented Apr 16, 2026

fix #7235

@revu-bot revu-bot bot requested a review from revu-bot April 16, 2026 13:29
@maxgfr maxgfr temporarily deployed to build-preproduction April 16, 2026 13:29 — with GitHub Actions Inactive
@maxgfr maxgfr changed the title fix(indemnite-licenciement): retirer la date de sortie fix(indemnite-licenciement): retirer la question sur la date de sortie pour la 3239 Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

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

Comment on lines +108 to +111
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;
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[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.

Suggested change
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;
};

Copy link
Copy Markdown
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

An internal error occurred. Please check the logs for details.

Revu logs

@sonarqubecloud
Copy link
Copy Markdown

@tokenbureau
Copy link
Copy Markdown

tokenbureau bot commented Apr 16, 2026

@maxgfr maxgfr requested a review from m-maillot April 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Simu IL] Supprimer la question sur la date de fin du préavis pour la convention collective 3239

2 participants