R-001 — Membership suspension notifies TRG Club
TLDR: When a membership is suspended in citrg-api, TRG Club is notified immediately via webhook so the therapist’s PRO access is revoked without delay.
Given / When / Then
Given a membership that is not suspended
When an admin suspends it via AdminAdministrativeProceduresService.suspend_membership
Then Notifications::Memberships::Suspension::NotifyTrgClubJob is enqueued and posts { email, register_number } to POST /citrg/memberships/suspended on the TRG Club API, which revokes the therapist’s PRO subscription
Constraints
- Must not notify TRG Club if the suspension itself fails
- Always retries up to 10 times with polynomial backoff on TRG Club downtime
- Never blocks the suspension flow — notification is async via GoodJob
- Discards the job silently if the membership no longer exists at execution time
Linked test
test/jobs/notifications/memberships/suspension/notify_trg_club_job_test.rb — “notifies trg-club with the membership email and register number”
test/services/admin_administrative_procedures_service_test.rb — “suspend_membership enqueues NotifyTrgClubJob”