FEAT-695: Bloquer la désinscription pour les sessions passées
📃 TICKET NOTION 📃
Summary
- Block unsubscriptions: Project-level setting (
blockUnsubscriptions) prevents participants from unsubscribing. Sessions that have already begun also block unsubscription. Volunteering sessions beginning within 2 days can be separately blocked viablockVolunteeringUnsubscribeIfBeginsSoon. - Rename
blockSubscriptions?blockUnsubscriptions: Field renamed across models, controllers, UI, locales, and a MongoDB migration. - Subscription pipeline refactor: Duplicated blocking logic across
getSessionInfoAlertandSubscribeUnsubscribeButtonconsolidated into a single pure functiongetSessionSubscriptionState? the new single source of truth for button variant, disabled state, alert message, and dimming.SubscribeUnsubscribeButtonrewritten in TypeScript as a thin renderer.getSessionInfoAlert.jsdeleted. - 32-test suite: Full test coverage for
getSessionSubscriptionStatecovering all branching paths (steward, auto-subscribed, team, blocked unsubscribe, blocked volunteering, normal unsubscribe, subscribe, alert priority, dimming, date conflicts).
Commits
- beeb9852 fix: Prevent modification of session and team subscriptions with MODIFY_REGISTRATION endpoint
- 720fc416 refactor: Rename badly named prop blockSubscriptions in project to blockUnsubscriptions, with migration file
- c31ee4e2 feat: implement blocking in UI with tooltip messages and all. Refactored the getSessionMetadata/getSessionInfoAlert data pipeline
- cdd9d462 test: add getSessionSubscriptionState test suite for subscription pipeline refactor
- d32027ef feat: implement getSessionSubscriptionState ? single source of truth for subscription pipeline
- 35a36d5d refactor: rewrite SubscribeUnsubscribeButton in TypeScript, consuming SessionSubscriptionState
- 9dcc1ba6 refactor: update SessionShow and SessionShowSmall to use getSessionSubscriptionState
- 0ce63281 refactor: delete getSessionInfoAlert.js ? absorbed into getSessionSubscriptionState
Edited by JulesLecuir