From 8579b1c62269cf1a190faf540c4ce6e7877b799f Mon Sep 17 00:00:00 2001 From: Kevin Haube Date: Fri, 8 Dec 2023 11:52:14 -0500 Subject: [PATCH 1/2] Comment out med spa exclusivity rule --- src/services/api/handlers/submit.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/services/api/handlers/submit.ts b/src/services/api/handlers/submit.ts index 9208986f6c..7899726372 100644 --- a/src/services/api/handlers/submit.ts +++ b/src/services/api/handlers/submit.ts @@ -16,7 +16,12 @@ const config = { }; import { Kafka, Message } from "kafkajs"; -import { Authority, OneMacSink, transformOnemac } from "shared-types"; +import { + Authority, + OneMacSink, + OneMacTransform, + transformOnemac, +} from "shared-types"; const kafka = new Kafka({ clientId: "submit", @@ -44,15 +49,15 @@ export const submit = async (event: APIGatewayEvent) => { }); } - if (body.authority !== Authority.MED_SPA) { - return response({ - statusCode: 400, - body: { - message: - "The Mako Submissions API only supports Medicaid SPA at this time", - }, - }); - } + // if (body.authority !== Authority.MED_SPA) { + // return response({ + // statusCode: 400, + // body: { + // message: + // "The Mako Submissions API only supports Medicaid SPA at this time", + // }, + // }); + // } const pool = await sql.connect(config); console.log(body); From bcc415b6bae0be700ad574134d0141820b56152a Mon Sep 17 00:00:00 2001 From: Kevin Haube Date: Fri, 8 Dec 2023 14:12:18 -0500 Subject: [PATCH 2/2] Enable chip spa submission --- src/packages/shared-types/authority.ts | 1 + src/services/api/handlers/submit.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/packages/shared-types/authority.ts b/src/packages/shared-types/authority.ts index a379b5460b..85e420851e 100644 --- a/src/packages/shared-types/authority.ts +++ b/src/packages/shared-types/authority.ts @@ -1,3 +1,4 @@ export enum Authority { MED_SPA = "medicaid spa", + CHIP_SPA = "chip spa", } diff --git a/src/services/api/handlers/submit.ts b/src/services/api/handlers/submit.ts index 7899726372..c8de5bc98f 100644 --- a/src/services/api/handlers/submit.ts +++ b/src/services/api/handlers/submit.ts @@ -49,15 +49,15 @@ export const submit = async (event: APIGatewayEvent) => { }); } - // if (body.authority !== Authority.MED_SPA) { - // return response({ - // statusCode: 400, - // body: { - // message: - // "The Mako Submissions API only supports Medicaid SPA at this time", - // }, - // }); - // } + const activeSubmissionTypes = [Authority.CHIP_SPA, Authority.MED_SPA]; + if (!activeSubmissionTypes.includes(body.authority)) { + return response({ + statusCode: 400, + body: { + message: `OneMAC (micro) Submissions API does not support the following authority: ${body.authority}`, + }, + }); + } const pool = await sql.connect(config); console.log(body);