From 6233cf73e2ce846db8a8beb072489b4ee3bed0f9 Mon Sep 17 00:00:00 2001 From: Mike Dial <48921055+mdial89f@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:32:07 -0500 Subject: [PATCH] fix(chip action type): Set action type to Amend for CHIP spa submissions (#401) * Set action type for chip * Correct logic error --- src/packages/shared-types/action-types/new-submission.ts | 2 +- src/services/api/handlers/submit.ts | 2 +- src/services/ui/src/pages/form/chip-form.tsx | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/packages/shared-types/action-types/new-submission.ts b/src/packages/shared-types/action-types/new-submission.ts index 9560b1be2f..afbbf0e47a 100644 --- a/src/packages/shared-types/action-types/new-submission.ts +++ b/src/packages/shared-types/action-types/new-submission.ts @@ -4,7 +4,7 @@ import { attachmentSchema } from "../attachments"; // This is the event schema for ne submissions from our system export const onemacSchema = z.object({ authority: z.string(), - seaActionType: z.string().optional(), // Used by waivers. + seaActionType: z.string().optional(), // Used by waivers and chip spas origin: z.string(), additionalInformation: z.string().nullable().default(null), submitterName: z.string(), diff --git a/src/services/api/handlers/submit.ts b/src/services/api/handlers/submit.ts index 643784c1c7..cd2c508039 100644 --- a/src/services/api/handlers/submit.ts +++ b/src/services/api/handlers/submit.ts @@ -92,7 +92,7 @@ export const submit = async (event: APIGatewayEvent) => { const result = await sql.query(query); console.log(result); - if (body.authority == Authority["1915b"]) { + if ([Authority["1915b"], Authority.CHIP_SPA].includes(body.authority)) { const actionTypeQuery = ` UPDATE SEA.dbo.State_Plan SET Action_Type = ( diff --git a/src/services/ui/src/pages/form/chip-form.tsx b/src/services/ui/src/pages/form/chip-form.tsx index d4e490f5d5..7238330a88 100644 --- a/src/services/ui/src/pages/form/chip-form.tsx +++ b/src/services/ui/src/pages/form/chip-form.tsx @@ -41,6 +41,7 @@ const formSchema = z.object({ other: zAttachmentOptional, }), proposedEffectiveDate: z.date(), + seaActionType: z.string().default("Amend"), }); type ChipFormSchema = z.infer;