Skip to main content

Status Lifecycles

This page is the authoritative reference for every status value in the system and the transitions the backend permits between them. Status values are transcribed verbatim from vruksha-backend/src/shared/enums/status.enum.ts. Transition arrows are taken from the module transition maps (where one exists in code) or presented conceptually (where the module does not enforce a strict map).

In each diagram, an arrow means the backend allows that transition. A status with no outgoing arrows is terminal — once reached, no further status change is accepted.


Stock (StockStatus — 11 statuses)

Source: STOCK_STATUS_TRANSITIONS in the stock-management module — strictly enforced.

ValueMeaning
WISHLISTLand/asset identified as a target; no commercial commitment yet.
IN_NEGOTIATIONActive negotiation with the seller is underway.
UNDER_POA purchase order / agreement to purchase is in place.
ADVANCEDAn advance payment has been made against the purchase.
REGISTEREDThe purchase is legally registered; the asset is owned.
ALLOCATEDThe registered stock has been allocated to a project.
ON_HOLDTemporarily paused (legal, due-diligence, or internal hold).
CANCELLEDThe acquisition was abandoned; the record is parked, not deleted.
PARTIALLY_SOLDPart of the allocated stock area has been sold.
COMPLETELY_SOLDThe entire allocated stock area has been sold.
SPLITThe stock was split into child stocks; the parent is locked. Terminal.

Key rules from the transition map:

  • SPLIT is never a manual next-state. The split operation (POST /stocks/:id/split) writes SPLIT directly after creating the child stocks. Once split, the parent is terminal.
  • ON_HOLD and CANCELLED are wide "escape hatches": from either, the stock can be returned to most active states. CANCELLED is recoverable (it is not terminal).
  • COMPLETELY_SOLD can only move to CANCELLED.

See also: Stock Allocations and the allocation workflow, which has its own status set (DRAFT → SUBMITTED → APPROVED → POSTED, with REJECTED/CANCELLED).


Unit (UnitStatus — 8 statuses)

Source: status.enum.ts. Unit status is driven by sales activity (quotation holds, sales orders) rather than a single freestanding transition map, so the diagram below is conceptual — it reflects the lifecycle the sales and unit modules produce in practice.

ValueMeaningCustomer-facing
DRAFTBeing configured; not released for sale.Hidden
AVAILABLEOpen for booking.Available
BLOCKEDTemporarily reserved / held (e.g. by a quotation hold).Unavailable
BOOKEDBooking confirmed via an active Sales Order.Unavailable
ADVANCEDAdvance received against the booking.Unavailable
REGISTEREDSold and registered.Unavailable
CANCELLEDUnit cancelled / withdrawn.Hidden
FROZENFrozen for legal, internal, or dispute reasons.Unavailable

Sales-driven behaviour: When a quotation places a hold, the unit moves to a held/BLOCKED state; releasing the hold returns it to AVAILABLE. A Sales Order going ACTIVE books the unit; the SO module syncs unit status on ACTIVE/COMPLETED/CANCELLED transitions.


Project (ProjectStatus — 6 statuses)

Source: status.enum.ts. The projects module does not enforce a strict transition map for project status, so the diagram is conceptual.

ValueMeaning
DRAFTProject record created; configuration in progress.
PLANNINGPlanning and structuring (holdings, allocations) underway.
ACTIVEProject is live and operational.
ON_HOLDTemporarily paused.
COMPLETEDProject finished.
CANCELLEDProject cancelled. Recommended terminal alternative to deletion when a project has dependencies.

Partnership (PartnershipStatus — 4 statuses)

Source: partnerships.service.ts — strictly enforced (DRAFT → ACTIVE → SUSPENDED/CLOSED).

ValueMeaning
DRAFTPartnership created; holdings being configured. Not yet operational.
ACTIVEOperational. Holdings must sum to 100% with exactly one managing partner before activation.
SUSPENDEDTemporarily not operational; cannot be modified while suspended.
CLOSEDPermanently closed. Terminal. Cannot be modified or deleted; recommended alternative to deletion.

Enforced transitions: DRAFT → ACTIVE; ACTIVE → SUSPENDED or CLOSED; SUSPENDED → ACTIVE or CLOSED; CLOSED → (none). Activating validates that active holdings total exactly 100.00% and that exactly one active managing partner exists.


Quotation (QuotationStatus — 4 enum values)

Source: quotations.service.ts — strictly enforced. Note: the quotation transition map in code also references an intermediate UNIT_HOLD state used when units from a quotation are placed on hold; it is shown below for completeness alongside the four canonical enum values (DRAFT, QUOTED, CANCELLED, CONVERTED).

ValueMeaning
DRAFTQuotation being prepared; not yet finalised.
QUOTEDFinalised and shared with the buyer (requires at least one unit).
UNIT_HOLDOne or more units from this quotation are currently held. Reverts to QUOTED when all holds are released.
CANCELLEDQuotation cancelled. Terminal. Held units are auto-released.
CONVERTEDConverted into a Sales Order. Terminal.

Enforced transitions: DRAFT → QUOTED or CANCELLED; QUOTED → CANCELLED (and, via the hold operation, QUOTED ↔ UNIT_HOLD); UNIT_HOLD → CANCELLED; CANCELLED and CONVERTED are terminal. Conversion to a Sales Order is allowed only from QUOTED or UNIT_HOLD.

See Sales Calculations for how quotation amounts are computed, and Quotations for the workflow.


Sales Order (SalesOrderStatus — 10 statuses)

Source: sales-orders.service.ts — strictly enforced.

ValueMeaning
DRAFTSales Order being prepared.
PENDING_APPROVALSubmitted and awaiting approval.
ACTIVEApproved and live; the unit is booked.
COMPLETEDFully executed (e.g. fully paid).
INVOICEDA Sales Invoice has been raised against this SO. Terminal for SO status.
CANCELLEDCancelled (a reason is mandatory). Terminal.
FORFEITEDBooking forfeited. Terminal.
SHIFTEDBooking shifted to another unit/SO. Terminal.
SPLITSales Order split. Terminal.
AGREEMENT_SIGNEDAgreement executed with the buyer (an interim milestone after ACTIVE).

Enforced transitions:

  • DRAFT → PENDING_APPROVAL
  • PENDING_APPROVAL → ACTIVE (approve), DRAFT (send back), or CANCELLED
  • ACTIVE → AGREEMENT_SIGNED, COMPLETED, CANCELLED, FORFEITED, SHIFTED, or SPLIT
  • AGREEMENT_SIGNED → COMPLETED, CANCELLED, FORFEITED, SHIFTED, or SPLIT
  • COMPLETED → CANCELLED
  • INVOICED, CANCELLED, FORFEITED, SHIFTED, SPLIT → terminal (no outgoing transitions)

INVOICED is set automatically when a Sales Invoice is created from the SO; it is not a manual target in the status transition map.

See Sales Orders for the workflow and Sales Calculations for amount computation.


Sales Invoice (SalesInvoiceStatus — 5 statuses)

Source: sales-invoices.service.ts — strictly enforced.

ValueMeaning
DRAFTInvoice being prepared. Only DRAFT invoices can be deleted.
ISSUEDIssued to the buyer (requires at least one buyer and one unit).
PARTIALLY_PAIDPartial payment received.
PAIDFully paid.
CANCELLEDCancelled (a reason is mandatory). Terminal.

Enforced transitions: DRAFT → ISSUED; ISSUED → PARTIALLY_PAID, PAID, or CANCELLED; PARTIALLY_PAID → PAID or CANCELLED; PAID → CANCELLED; CANCELLED is terminal.

See Sales Invoices for the workflow.


User (UserStatus — 6 statuses)

Source: status.enum.ts. User status is the product of authentication and admin actions (verification, invitation, lockout, suspension) rather than a single transition map, so the diagram is conceptual. See Auth Flows for the precise rules behind each transition.

ValueMeaning
DISABLEDDefault for a new user; no login access until enabled/invited.
INVITEDA login invitation has been sent and is pending acceptance (invitations expire after 7 days).
ACTIVEVerified and active; can log in.
SUSPENDEDTemporarily blocked by an administrator.
LOCKEDLocked after exceeding the failed-login limit (5 failures → 15-minute lockout).
UNVERIFIEDAccount exists but the email has not yet been verified.

Quick reference: terminal states

EntityTerminal states (no further transitions)
StockSPLIT
PartnershipCLOSED
QuotationCANCELLED, CONVERTED
Sales OrderINVOICED, CANCELLED, FORFEITED, SHIFTED, SPLIT
Sales InvoiceCANCELLED

Unit, Project, and User do not have a strictly enforced transition map; their "terminal" states (e.g. unit REGISTERED, project COMPLETED/CANCELLED) are conceptual.