Pipeline state machine, conditions, templates, NATS events

Featurekamo-shared-library
Shipped
May 15, 2026 at 6:43 PM UTC
Author
Kamo
Commit
6dfbf70

Sub-project 4 (LOS pipeline & workflow) backend: - New enum LoanConditionStatus (OPEN/CLEARED/WAIVED) - New entities: LoanPipelineMilestone (append-only transition audit), LoanCondition (per-loan checklist row with own state), and LoanConditionTemplate (per-org reusable checklist source) - New repos for each, plus a one-shot blocking-condition query - LoanPipelineStateMachine declares the URLA pipeline (DRAFT through FUNDED) and the universal SUSPENDED/WITHDRAWN/DENIED off-ramps, with required RoleRightType for each arrow - LoanPipelineService orchestrates a transition atomically: validate legality + right + blocking conditions (override gated by LOS_UNDERWRITE_LOAN), stamp the appropriate LoanFile date column, write a milestone, write an ApplicationSubmission for legally-significant transitions (initial disclosure, resubmit processing/underwriting) with SHA-256 snapshot, publish a NATS event - LoanConditionService and LoanConditionTemplateService cover the rest of the CRUD surface - LosPipelinePublisher publishes to JetStream subjects los.pipeline.transition.<orgId> and los.pipeline.condition.<orgId> - NatsConfig provisions a dedicated LOS_PIPELINE stream alongside the existing chat stream so retention can be tuned independently - Six new RoleRightType entries under ServiceType.LOS (renamed to "Commerce: Loan Origination System"): LOS_VIEW_PIPELINE, LOS_TAKE_APPLICATION, LOS_PROCESS_LOAN, LOS_UNDERWRITE_LOAN, LOS_CLOSE_AND_FUND, LOS_SUSPEND_OR_WITHDRAW

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing