migration 093: add awaiting_intake fulfillment status for MCS-150 intake gate

This commit is contained in:
justin 2026-06-10 14:14:45 -05:00
parent a3aeedd716
commit 983c732baf

View file

@ -0,0 +1,12 @@
-- Add 'awaiting_intake' fulfillment status for MCS-150/DOT orders that are
-- held waiting on the customer to confirm operational details the FMCSA
-- census cannot supply (operation classification, cargo, current mileage,
-- email). The worker sets this state and emails a census-pre-filled intake
-- link; the order auto-resumes when the customer submits.
ALTER TABLE compliance_orders DROP CONSTRAINT IF EXISTS compliance_orders_fulfillment_status_check;
ALTER TABLE compliance_orders ADD CONSTRAINT compliance_orders_fulfillment_status_check
CHECK (fulfillment_status IS NULL OR fulfillment_status = ANY (ARRAY[
'authorization_required','authorization_signed','awaiting_customer_delegation',
'awaiting_secure_credentials','awaiting_government_fee_approval','awaiting_insurance_filing',
'awaiting_intake','ready_to_file','filed_waiting_state','completed'
]));