Status lifecycle
Every Sertiq object that flows through a workflow has an explicit status column and a state machine the RPC layer enforces. This page is the canonical reference — UI dropdowns are built from these tables.
┌─────────────────────────┐ ▼ │draft ─► open ─► inProgress ─► closed │ │ ▲ └───────────┴────────► disputed ─┘| From | To | Allowed by | Side effects |
|---|---|---|---|
| — | draft | Editor / Admin | Created by autosave; not counted in quota |
draft | open | Editor / Admin (publish) | Assigns NCR-YYYY-NNNN; counts against monthly cap |
open | inProgress | Editor / Admin | None |
inProgress | closed | Editor / Admin | Stamps closed_at; feeds analytics |
open / inProgress | disputed | Editor / Admin | Surfaces in escalation view |
disputed | inProgress | Editor / Admin | Resumes investigation |
disputed | closed | Editor / Admin | Stamps closed_at |
| any | (deleted) | Admin only | Hard delete; cascades to attachments |
A critical-severity NCR cannot be published without a containment_action. The constraint is enforced both client-side and as a CHECK on the table.
draft ─► open ─► inProgress ─► pendingVerification ─► closed| From | To | Allowed by | Side effects |
|---|---|---|---|
| — | draft | Editor / Admin | Created by autosave; not counted |
draft | open | Editor / Admin (publish) | Notifies assignee via email |
open | inProgress | Assignee / Admin | Comment ≥3 chars required |
inProgress | pendingVerification | Assignee / Admin | Comment required; surfaces in reviewer queue |
pendingVerification | closed | Reviewer (Admin / Editor ≠ assignee) | Stamps closed_at; sets effectiveness_check_due_at = closed_at + 30 days |
pendingVerification | inProgress | Reviewer | Re-opens for more work; comment required |
| any | (deleted) | Admin only | Hard delete; preserves parent NCR |
Every status transition writes a row to capa_updates with the actor, old status, new status, and a comment 3–4,000 characters (enforced by CHECK). There is no silent edit of a CAPA’s state.
Effectiveness verification (post-close)
Section titled “Effectiveness verification (post-close)”After closed_at + 30 days, a closed CAPA surfaces in the Effectiveness queue. verify_capa_effectiveness writes one of:
| Rating | What it means |
|---|---|
effective | Root cause fixed; no recurrence. Permanent close. |
partially_effective | Improvement seen; residual risk. Open a follow-up CAPA. |
ineffective | Problem recurred or never addressed. Reopen or escalate. |
Only admins and editors (other than the assignee) can verify. The verification stamps effectiveness_verified_at / _by.
RMA (Pro+ plan)
Section titled “RMA (Pro+ plan)”draft ─► requested ─► approved ─► shipped ─► received ─► closed │ │ └────► rejected| From | To | Allowed by | Side effects |
|---|---|---|---|
| — | draft | Editor / Admin | Autosave |
draft | requested | Editor / Admin | Generates RMA-YYYY-NNNN; sends supplier email if address on file |
requested | approved | Editor / Admin | Records supplier approval reference |
requested | rejected | Editor / Admin | Closes the flow; counts toward supplier risk |
approved | shipped | Editor / Admin | Records tracking number |
shipped | received | Editor / Admin | Records receipt evidence |
received | closed | Editor / Admin | Stamps closed_at |
| any | (deleted) | Admin only | Hard delete |
RMAs are bound to an NCR — closing an RMA does not close its parent NCR, and vice versa, but the audit .docx cross-references them.
Supplier evaluation
Section titled “Supplier evaluation”Evaluations are not workflow objects (no inProgress state) — they are a record produced and signed in one sitting. The lifecycle is:
draft ─► finalised ─► (next evaluation supersedes)| From | To | Allowed by | Side effects |
|---|---|---|---|
| — | draft | Editor / Admin | In-progress scoring |
draft | finalised | Editor / Admin | Stamps evaluated_at; recomputes supplier quality score and risk band |
Finalised evaluations are immutable. To correct a mistake, run a new evaluation — historical ones stay in the supplier’s evaluation history for the audit trail.
Supplier (lifecycle, not workflow)
Section titled “Supplier (lifecycle, not workflow)”Suppliers don’t have a workflow status — they have an active / inactive flag.
| State | Behaviour |
|---|---|
active | Appears in supplier picker; counts against plan limit; included in analytics |
inactive | Hidden from picker; excluded from limit and risk recompute; historical NCRs / CAPAs still visible |
Suppliers with open NCRs or RMAs cannot be hard-deleted — the cascade is blocked at the RPC layer. Close or deactivate first.
Quota counting summary
Section titled “Quota counting summary”Across all objects, draft never counts. Quotas, dashboards, supplier risk scores, AI-call eligibility — every aggregate filters status != 'draft'. See Drafts & autosave.
Audit log coverage
Section titled “Audit log coverage”Every transition listed above writes to audit_log with action, actor_id, target_id, org_id, metadata, created_at. The log is immutable and surfaces under Settings → Audit log for admins.
Related
Section titled “Related”- NCRs — fields and severities.
- CAPA — comment-required updates and effectiveness verification.
- Drafts & autosave — why drafts don’t count.
- Glossary — definitions of severity, root cause, etc.