# Dealer Offboarding โ€” Test Cases & QA Tracker > **Location:** `/backend/docs/TEST_CASES.md` > **Last Updated:** 2026-04-20 > **Modules Covered:** Termination, Resignation, F&F Settlement, Constitutional Change, Relocation > **Status Legend:** โœ… Fixed | โŒ Open | ๐Ÿ”„ In Progress | โš ๏ธ Known Issue --- ## 1. Termination Module ### 1.1 Push to F&F Action | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | T-01 | Click "Push to F&F" when stage is `NBH Evaluation` | Backend returns **400** โ€” `Cannot trigger F&F from NBH Evaluation. Complete CEO and Legal approvals first.` | โœ… Fixed | Backend gate added in `termination.controller.ts` | | T-02 | Click "Push to F&F" when stage is `Legal - Termination Letter` | F&F settlement created successfully; termination status โ†’ `F&F Initiated`; stage โ†’ `Terminated` | โœ… Fixed | Stage lock + correct status applied | | T-03 | Click "Push to F&F" multiple times on the same record | Only one F&F record created (idempotency check via `db.FnF.findOne`) | โœ… Fixed | `TerminationWorkflowService.initiateFnF` resolves existing record | | T-04 | After "Push to F&F", verify "Approve" button visibility | Approve button **must be hidden** โ€” workflow locked | โœ… Fixed | `isSettlementPhase` flag disables all approval actions | | T-05 | "Push to F&F" button visible to ASM role | Button **must not be visible** to ASM | โœ… Fixed | Role restricted to `DD Lead, DD Head, NBH, DD Admin, Super Admin` | | T-06 | "Push to F&F" button visible at early stages (e.g. ZBH Review) | Button **must be hidden** until stage is `Legal - Termination Letter` or `Terminated` | โœ… Fixed | Frontend `canPushToFnF` condition updated | | T-07 | After "Push to F&F", another approver tries to approve | Action rejected โ€” buttons completely hidden | โœ… Fixed | `isSettlementPhase` + `isFinalState` guard | --- ### 1.2 Stage Approval Flow | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | T-08 | Sending `action: "pushfnf"` via API when ticket is mid-flow | Previously fell into generic "Approve" block and advanced stage incorrectly | โœ… Fixed | Explicit `pushfnf` handler added | | T-09 | RBM approves at `RBM Review` | Stage advances to `ZBH Review` | โœ… | Standard flow | | T-10 | NBH at `NBH Evaluation` clicks "Issue SCN" | Stage advances to `Show Cause Notice` | โœ… | `canIssueSCN` permission guarded | | T-11 | ASM tries to Approve/Send Back | Buttons **must not be visible** โ€” ASM is Create/View/Comment only | โœ… | SRS ยง8.3.4 enforced | --- ### 1.3 Progress Timeline / Status Display | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | T-12 | Termination reaches `Dealer Terminated` stage | All stages including "Dealer Terminated" show **green checkmark** | โœ… Fixed | `isSuccessFinal` flag added to `getProgressStatus()` | | T-13 | Termination status is `F&F Initiated` | All completed stages show green; "Dealer Terminated" shows green | โœ… Fixed | `F&F Initiated`, `Settled` included in `isSuccessFinal` | | T-14 | Termination is `Rejected` | Shows all stages up to rejection point; no misleading pending | โœ… | `isTerminal` logic handles rejected states | --- ## 2. Resignation Module ### 2.1 Push to F&F Action | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | R-01 | Click "Push to F&F" before Legal stage | Backend returns **400** โ€” `Cannot trigger F&F from [stage]. Move request to Legal stage first.` | โœ… | Gate in `resignation.controller.ts` | | R-02 | Click "Push to F&F" at Legal stage without a Legal-stage document | Backend returns **400** โ€” `Legal-stage acceptance/communication document is required first.` | โœ… | Document gate enforced | | R-03 | Click "Push to F&F" at Legal stage with document present | F&F initiated; stage โ†’ `F&F Initiated` | โœ… | | | R-04 | Dealer role attempts to withdraw after reaching NBH stage | Withdraw button **must be hidden** | โœ… | `isPastNBH` guard in `canWithdraw` | | R-05 | "Push to F&F" visible to ASM role | Button **must NOT be visible** | โœ… | Role whitelist enforced | --- ## 3. F&F Settlement Module ### 3.1 Document Management | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | F-01 | Upload document via F&F Details page | File stored, mapped in `clearanceDocuments`, appears in Submitted Documents table | โœ… Fixed | Multipart upload implemented in `settlement.controller.ts` | | F-02 | Download uploaded F&F document | Forces direct file download (not new tab) | โœ… Fixed | Programmatic Blob fetch + hidden `` tag | | F-03 | Preview uploaded F&F document | โŒ Open | Pending implementation | ### 3.2 Status Display | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | F-04 | F&F Status badge text readability | White text on green/amber badges | โœ… Fixed | `text-white` applied in `FinanceFnFPage.tsx` | --- ## 4. Constitutional Change Module ### 4.1 Document Verification Permissions | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | C-01 | ASM sees "Verify" button on uploaded documents | Button **must NOT be visible** to ASM | โœ… Fixed | Role whitelist: `DD Lead, DD Head, NBH, Legal Admin, DD Admin, Super Admin` | | C-02 | ASM sees "Reject" button on uploaded documents | Button **must NOT be visible** to ASM | โœ… Fixed | Same role whitelist | | C-03 | DD Lead sees "Verify" button on uploaded documents | Button **must be visible** | โœ… | | | C-04 | NBH sees "Verify" button | Button **must be visible** | โœ… | | | C-05 | Dealer role sees "Verify" button | Button **must NOT be visible** | โœ… | | --- ## 5. Relocation Module ### 5.1 Document Verification Permissions | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | RL-01 | ASM sees "Verify" button on relocation documents | Button **must NOT be visible** | โœ… Fixed | Same role whitelist applied in `RelocationRequestDetails.tsx` | | RL-02 | ASM sees "Reject" button on relocation documents | Button **must NOT be visible** | โœ… Fixed | | | RL-03 | DD Admin sees "Verify" button | Button **must be visible** | โœ… | | --- ## 6. Role-Based Access Control (RBAC) Cross-Module | # | Test Case | Expected Behaviour | Status | Notes | |---|---|---|---|---| | RBAC-01 | ASM document verify access โ€” Constitutional Change | โŒ Hidden โœ… Fixed | See C-01 | | RBAC-02 | ASM document verify access โ€” Relocation | โŒ Hidden โœ… Fixed | See RL-01 | | RBAC-03 | ASM workflow approve buttons โ€” Termination | ASM sees no Approve/Send Back | โœ… | SRS ยง8.3.4 | | RBAC-04 | Dealer sees full termination workflow details | Dealer is **read-only** | โœ… | | | RBAC-05 | National roles access F&F data | โœ… Permitted | โœ… | Permission added | --- ## 7. Pending / Open Test Cases > Items that still require QA testing or implementation. | # | Test Case | Module | Priority | Notes | |---|---|---|---|---| | P-01 | F&F Document Preview modal | F&F | Medium | Upload/Download done; Preview pending | | P-02 | SLA breach notification triggers | All modules | High | SLA configuration not yet built | | P-03 | WhatsApp notification on SCN issued | Termination | High | Awaiting API dependency | | P-04 | In-app notification on F&F initiation | F&F | Medium | | | P-05 | Audit log context sweep across all modules | All modules | Medium | Ensure all actions are logged with correct entity context | | P-06 | Admin SLA Matrix configuration | Admin Dashboard | High | Pending implementation | --- ## 8. Regression Checklist (Run after every release) - [ ] Termination: "Push to F&F" rejected before Legal stage (T-01) - [ ] Termination: Progress timeline shows all green on completion (T-12) - [ ] Termination: "Push to F&F" button hidden at early stages (T-06) - [ ] Resignation: Dealer withdrawal blocked after NBH (R-04) - [ ] Constitutional: ASM cannot verify documents (C-01, C-02) - [ ] Relocation: ASM cannot verify documents (RL-01, RL-02) - [ ] F&F: Document download forces save to disk (F-02) - [ ] F&F: Status badges show white text (F-04) --- ## 9. In-App & Email Notification Coverage > All notifications flow through `notifyStakeholdersOnTransition()` in `workflow-email-notifications.ts`. ### 9.1 Root Cause (Fixed) Old code only notified `nextActor` and `dealer`. ASM was silently skipped after the initial submission email. **Fix applied:** `workflow-email-notifications.ts` now covers 4 notification paths: 1. **Next Actor** โ†’ `Action Required` (system + email) 2. **ASM on Send Back** โ†’ `Case Returned for Clarification` (system + email) 3. **Dealer** โ†’ status update (system always; email only on terminal events) 4. **Key Observers** (DD Lead, DD Head, NBH, DD Admin) โ†’ `Case Closed` (system only, on reject/revoke/complete) ### 9.2 Notification Test Cases | # | Scenario | Who Should Be Notified | Channel | Status | |---|---|---|---|---| | N-01 | Constitutional change submitted | All participants incl. ASM | email + in-app | โœ… (submit hook) | | N-02 | ASM approves โ†’ moves to ZM/RBM | ZM + RBM | email + in-app | โœ… Fixed | | N-03 | ZBH approves โ†’ moves to DD Lead | DD Lead | email + in-app | โœ… Fixed | | N-04 | Any approver sends back | ASM | email + in-app | โœ… Fixed | | N-05 | Request rejected | Dealer (email + in-app), DD Lead/Head/NBH/DD Admin (in-app only) | mixed | โœ… Fixed | | N-06 | Request revoked | Dealer (email + in-app), key observers (in-app only) | mixed | โœ… Fixed | | N-07 | Request completed (legal approved) | Dealer (email + in-app), key observers (in-app only) | mixed | โœ… Fixed | | N-08 | Relocation submitted | Dealer (email), ASM (email + in-app) | email + in-app | โœ… Already existed | | N-09 | Resignation submitted | All participants incl. ASM | email + in-app | โœ… Already existed | | N-10 | ZM/RBM joint: first approver approves | Other co-approver (ZM or RBM) | in-app | โœ… Verified | | N-11 | Termination pushed to F&F | DD Admin, Finance | in-app | โœ… Verified | | N-12 | ASM who submitted gets status update on any stage change | ASM | in-app | โœ… Verified | ### 9.3 Known Remaining Gaps (Open) | ID | Scenario | Channels | Status | |----|----------|----------|--------| | N-G1 | ZM/RBM co-approver notification for partner approvals | System, Email, WhatsApp | **Verified (v2.1)** | | N-G2 | F&F initiation notification to DD Admin/Finance | System, Email, WhatsApp | **Verified (v2.1)** | | N-G3 | Dealer withdrawal from resignation notification to ASM | System, Email, WhatsApp | **Verified (v2.1)** | | N-G4 | Interview Scheduling acknowledgment to Dealer | Email, WhatsApp | **Verified (v2.1)** | | N-G5 | Interview Panelist assignment notification | Email, WhatsApp | **Verified (v2.1)** | > [!NOTE] > All WhatsApp notifications now dynamically resolve phone numbers from the participant's user record or the application record as per SRS ยง1.1.1. --- *This file is maintained as a living document. Add new test cases as bugs are found or features are added.*