From 7d8a08d9d38d28e2fbca1ddee7d97528cc20a44a Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 10 Jun 2026 14:52:36 -0500 Subject: [PATCH] mcs150: scope intake-completion email to actual MCS-150-form services MCS150UpdateHandler is the catch-all for many admin-assisted DOT services (UCR, MC authority, audit prep, ETA, name reservation, registered agent, annual report). My new intake-completeness gate was firing the 'confirm your MCS-150 details' email for ALL of them -- e.g. a UCR order wrongly emailed the customer about MCS-150 details. Scope the gate to MCS150_FORM_SLUGS (the services that actually file an MCS-150: mcs150-update, dot-registration, usdot-reactivation, dot-full-compliance). --- scripts/workers/services/mcs150_update.py | 31 ++++++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/scripts/workers/services/mcs150_update.py b/scripts/workers/services/mcs150_update.py index e3937cd..69f461a 100644 --- a/scripts/workers/services/mcs150_update.py +++ b/scripts/workers/services/mcs150_update.py @@ -58,6 +58,17 @@ class MCS150UpdateHandler: SERVICE_SLUG = "mcs150-update" SERVICE_NAME = "MCS-150 Biennial Update" + # Services routed to this handler that actually produce an MCS-150 form + # (and thus need the operational-detail intake gate). Other slugs routed + # here (UCR, MC authority, audit prep, ETA, name reservation, registered + # agent, annual report, etc.) are admin-assisted and do NOT file an MCS-150. + MCS150_FORM_SLUGS = frozenset({ + "mcs150-update", + "dot-registration", + "usdot-reactivation", + "dot-full-compliance", + }) + async def process(self, order_data: dict) -> list[str]: """Entry point called by job_server. Delegates to handle().""" order_number = order_data.get("order_number", order_data.get("name", "")) @@ -133,13 +144,19 @@ class MCS150UpdateHandler: # complete a short, census-pre-filled intake and hold the order until # they do. (New-registration / reactivation flows that have not yet # signed also route through here.) - missing = self._missing_intake_fields(slug, intake) - if missing and not client_approved and not admin_approved: - self._request_intake_completion( - order_number, entity_name, customer_email, dot_number, missing) - LOG.info("[%s] Held for customer intake completion; missing=%s", - order_number, missing) - return [] + # + # Only applies to services that actually produce an MCS-150 form. This + # handler is also the catch-all for several admin-assisted DOT services + # (UCR, MC authority, audit prep, ETA) that do NOT file an MCS-150 and + # must not receive the "confirm your MCS-150 details" intake email. + if slug in self.MCS150_FORM_SLUGS: + missing = self._missing_intake_fields(slug, intake) + if missing and not client_approved and not admin_approved: + self._request_intake_completion( + order_number, entity_name, customer_email, dot_number, missing) + LOG.info("[%s] Held for customer intake completion; missing=%s", + order_number, missing) + return [] # Step 1: Fill the official MCS-150 PDF pdf_path = None