From 81ecd4feb1cd830fe00a6048d6a6cb5b4fb6cc52 Mon Sep 17 00:00:00 2001 From: Hana Worku Date: Thu, 6 Jun 2024 09:53:09 -0500 Subject: [PATCH] More adjustments --- .../convertHPPtoContractWithRates.ts | 12 +++++++----- services/app-api/src/testHelpers/gqlHelpers.ts | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/services/app-api/src/domain-models/contractAndRates/convertHPPtoContractWithRates.ts b/services/app-api/src/domain-models/contractAndRates/convertHPPtoContractWithRates.ts index ffb47e66ec..a58d4f3bbb 100644 --- a/services/app-api/src/domain-models/contractAndRates/convertHPPtoContractWithRates.ts +++ b/services/app-api/src/domain-models/contractAndRates/convertHPPtoContractWithRates.ts @@ -1,5 +1,6 @@ import type { UnlockedHealthPlanFormDataType } from 'app-web/src/common-code/healthPlanFormDataType' import type { ContractFormData, RateFormData } from '../../gen/gqlServer' +import dayjs from 'dayjs' // interim solution -this file was made to deal with test helpers that may expect contract rates when we only have HPP coming from another test helper @@ -32,8 +33,8 @@ const convertUnlockedHPPToContractAndRates = ( stateContacts, contractType, contractExecutionStatus, - contractDateStart, - contractDateEnd, + contractDateStart: dayjs(contractDateStart).format('YYYY-MM-DD'), + contractDateEnd: dayjs(contractDateEnd).format('YYYY-MM-DD'), programIDs, contractDocuments, supportingDocuments: documents, @@ -87,9 +88,10 @@ const convertUnlockedHPPToContractAndRates = ( rateType, rateCapitationType, rateCertificationName, - rateDateCertified, - rateDateEnd, - rateDateStart, + rateDateCertified: + dayjs(rateDateCertified).format('YYYY-MM-DD'), + rateDateEnd: dayjs(rateDateEnd).format('YYYY-MM-DD'), + rateDateStart: dayjs(rateDateStart).format('YYYY-MM-DD'), rateDocuments, supportingDocuments, rateProgramIDs, diff --git a/services/app-api/src/testHelpers/gqlHelpers.ts b/services/app-api/src/testHelpers/gqlHelpers.ts index 6296a6d6ba..4d22ce933a 100644 --- a/services/app-api/src/testHelpers/gqlHelpers.ts +++ b/services/app-api/src/testHelpers/gqlHelpers.ts @@ -236,7 +236,15 @@ const createAndUpdateTestHealthPlanPackage = async ( ? [must(findStatePrograms(stateCode))[0]] : [defaultFloridaRateProgram()] - const draft: Partial = { + const draft: UnlockedHealthPlanFormDataType = { + id: uuidv4(), + createdAt: new Date(Date.now()), + updatedAt: new Date(Date.now()), + status: 'DRAFT', + stateCode: stateCode || 'FL', + stateNumber: 1, + programIDs: [], + documents: [], submissionType: 'CONTRACT_AND_RATES' as const, submissionDescription: 'An updated submission', stateContacts: [ @@ -319,10 +327,10 @@ const createAndUpdateTestHealthPlanPackage = async ( } Object.assign(draft, partialUpdates) + const [contractFormData, rateFormDatas] = - convertUnlockedHPPToContractAndRates( - draft as UnlockedHealthPlanFormDataType - ) + convertUnlockedHPPToContractAndRates(draft) + const contract = await createAndUpdateTestContractWithoutRates( server, stateCode,