Dealer_Onboarding_Backend/docs/sla/ONBOARDING_SLA_RULES.md

55 lines
2.9 KiB
Markdown

# Onboarding — what uses SLA vs applicant reminders
SRS §9.4 SLA applies to **internal role turnaround** (ASM, RBM, FDD, Finance, etc.).
It does **not** apply to steps the **prospect/dealer** performs on the public portal.
## Do not configure internal SLA
| Pipeline step | Why | What to use instead |
|---------------|-----|---------------------|
| **Submitted** | Application is already submitted; no internal approver waiting. | None (audit only). |
| **Questionnaire** | **Prospect** fills the questionnaire, not ASM/RBM. | **Scheduled BullMQ job** + manual bulk: `QUESTIONNAIRE_REMINDER` to applicant (`QuestionnaireReminderService`, requires `ENABLE_REDIS=true`). |
Runtime: `shouldTrackOnboardingSla()` skips these in `WorkflowService`. Re-seed sets `isActive: false` on old config rows.
## Internal SLA (configured)
| Step | Owner (internal) | Real scenario |
|------|------------------|---------------|
| Shortlist | DD Admin | Admin reviews leads and shortlists (§6.6). |
| 1st / 2nd / 3rd Level Interview | RBM+DD-ZM, DD Lead+ZBH, NBH+DD Head | Panel feedback TAT after interviews are scheduled. |
| FDD | FDD | External agency report upload/review. |
| LOI Approval | NBH | Internal LOI approval gate. |
| Security Deposit | Finance | Finance verifies payment proof uploaded by applicant. |
| LOI Issue | DD Admin | LOI issuance processing. |
| Dealer Code Generation | DD Admin | Code generation task. |
| Architecture / Statutory Work | Architecture Team / DD Admin+Legal | Parallel compliance tracks. |
| LOA | NBH | LOA approval. |
| EOR Complete | DD Admin | EOR milestone. |
| Inauguration | ASM | Post-EOR inauguration coordination. |
## Applicant-facing communications (not SLA matrix)
| Template | Audience | Trigger |
|----------|----------|---------|
| `OPPORTUNITY` / portal link | Applicant | Opportunity conversion |
| `QUESTIONNAIRE_REMINDER` | Applicant | DD Admin bulk reminder (pending questionnaire) |
| `QUESTIONNAIRE_SUBMITTED` | Applicant | On questionnaire submit |
| `ONBOARDING_STATUS_UPDATE` | Applicant | Status changes |
## Scheduled prospect reminders (not SLA Configuration UI)
| Env variable | Default | Meaning |
|--------------|---------|---------|
| `ENABLE_REDIS` | `false` | Must be `true` for scheduler |
| `QUESTIONNAIRE_REMINDER_SCHEDULER_ENABLED` | `true` | Master switch |
| `QUESTIONNAIRE_REMINDER_FIRST_AFTER_DAYS` | `1` | Wait after entering Questionnaire Pending |
| `QUESTIONNAIRE_REMINDER_INTERVAL_DAYS` | `2` | Min days between repeat emails |
| `QUESTIONNAIRE_REMINDER_MAX_COUNT` | `5` | Max auto reminders per application |
| `DEBUG_QUESTIONNAIRE_REMINDER_FAST_MODE` | off | Sweep every 15 min (dev) |
**Cron:** daily 09:00 (same pattern as LWD admin sweep).
**Code:** `questionnaire-reminder.queue.ts``QuestionnaireReminderService.processScheduledReminders()`.
Internal **SLA worker** (`sla.worker.ts`) only processes `sla_tracking` rows for **internal roles** — it does not email prospects.