From 420afe5f2446ec6224edccc0d8a629c88e34b5be Mon Sep 17 00:00:00 2001 From: Jason Lin Date: Tue, 12 Sep 2023 17:02:19 -0400 Subject: [PATCH] Change handler name and add test for connecting a submitted rate. --- .../findContractWithHistory.test.ts | 8 +- .../findRateWithHistory.test.ts | 18 +-- .../src/postgres/contractAndRates/index.ts | 4 +- .../contractAndRates/unlockContract.test.ts | 12 +- ...s => updateDraftContractWithRates.test.ts} | 100 +++++++++----- ...act.ts => updateDraftContractWithRates.ts} | 130 +++++++++--------- .../app-api/src/postgres/postgresStore.ts | 7 +- .../updateHealthPlanFormData.test.ts | 5 +- .../updateHealthPlanFormData.ts | 2 +- .../app-api/src/testHelpers/storeHelpers.ts | 2 +- 10 files changed, 163 insertions(+), 125 deletions(-) rename services/app-api/src/postgres/contractAndRates/{updateDraftContract.test.ts => updateDraftContractWithRates.test.ts} (89%) rename services/app-api/src/postgres/contractAndRates/{updateDraftContract.ts => updateDraftContractWithRates.ts} (75%) diff --git a/services/app-api/src/postgres/contractAndRates/findContractWithHistory.test.ts b/services/app-api/src/postgres/contractAndRates/findContractWithHistory.test.ts index e4990f9234..294e0e7142 100644 --- a/services/app-api/src/postgres/contractAndRates/findContractWithHistory.test.ts +++ b/services/app-api/src/postgres/contractAndRates/findContractWithHistory.test.ts @@ -5,7 +5,7 @@ import { submitContract } from './submitContract' import { submitRate } from './submitRate' import { insertDraftContract } from './insertContract' import { unlockContract } from './unlockContract' -import { updateDraftContract } from './updateDraftContract' +import { updateDraftContractWithRates } from './updateDraftContractWithRates' import { insertDraftRate } from './insertRate' import { updateDraftRate } from './updateDraftRate' import { unlockRate } from './unlockRate' @@ -194,7 +194,7 @@ describe('findContract', () => { ) ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contractA.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -472,7 +472,7 @@ describe('findContract', () => { ) // Remove rate 1 and rate 2 from contract must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contractA.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -605,7 +605,7 @@ describe('findContract', () => { await insertDraftContract(client, draftContractData) ) const updatedDraftContractWithRates = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contractA.id, formData: { submissionType: 'CONTRACT_AND_RATES', diff --git a/services/app-api/src/postgres/contractAndRates/findRateWithHistory.test.ts b/services/app-api/src/postgres/contractAndRates/findRateWithHistory.test.ts index 03f70b79ed..8d5bf0e055 100644 --- a/services/app-api/src/postgres/contractAndRates/findRateWithHistory.test.ts +++ b/services/app-api/src/postgres/contractAndRates/findRateWithHistory.test.ts @@ -4,7 +4,7 @@ import { submitContract } from './submitContract' import { submitRate } from './submitRate' import { insertDraftContract } from './insertContract' import { unlockContract } from './unlockContract' -import { updateDraftContract } from './updateDraftContract' +import { updateDraftContractWithRates } from './updateDraftContractWithRates' import { insertDraftRate } from './insertRate' import { updateDraftRate } from './updateDraftRate' import { unlockRate } from './unlockRate' @@ -62,7 +62,7 @@ describe('findRate', () => { }) ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract1.id, formData: { submissionDescription: 'someurle.en' }, rateFormDatas: [rateA.draftRevision.formData], @@ -79,7 +79,7 @@ describe('findRate', () => { }) ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract2.id, formData: { submissionDescription: 'twopointo' }, rateFormDatas: [rateA.draftRevision.formData], @@ -96,7 +96,7 @@ describe('findRate', () => { }) ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract3.id, formData: { submissionDescription: 'threepointo' }, rateFormDatas: [rateA.draftRevision.formData], @@ -156,7 +156,7 @@ describe('findRate', () => { ) ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: unlockedContract2.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -200,7 +200,7 @@ describe('findRate', () => { ) ) as DraftContractType must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: unlockedContract1.id, formData: { submissionDescription: 'onepointone' }, rateFormDatas: [rateA.draftRevision.formData], @@ -512,7 +512,7 @@ describe('findRate', () => { ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contractA.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -543,7 +543,7 @@ describe('findRate', () => { ) ) const updatedDraftContractA = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contractA.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -557,7 +557,7 @@ describe('findRate', () => { ) // Remove rate1 from contract must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: updatedDraftContractA.id, formData: {}, rateFormDatas: diff --git a/services/app-api/src/postgres/contractAndRates/index.ts b/services/app-api/src/postgres/contractAndRates/index.ts index f17827c243..8ad739fed9 100644 --- a/services/app-api/src/postgres/contractAndRates/index.ts +++ b/services/app-api/src/postgres/contractAndRates/index.ts @@ -1,9 +1,9 @@ export type { InsertContractArgsType } from './insertContract' -export type { UpdateContractArgsType } from './updateDraftContract' +export type { UpdateContractArgsType } from './updateDraftContractWithRates' export type { ContractOrErrorArrayType } from './findAllContractsWithHistoryByState' export { insertDraftContract } from './insertContract' export { findContractWithHistory } from './findContractWithHistory' -export { updateDraftContract } from './updateDraftContract' +export { updateDraftContractWithRates } from './updateDraftContractWithRates' export { findAllContractsWithHistoryByState } from './findAllContractsWithHistoryByState' export { findAllContractsWithHistoryBySubmitInfo } from './findAllContractsWithHistoryBySubmitInfo' diff --git a/services/app-api/src/postgres/contractAndRates/unlockContract.test.ts b/services/app-api/src/postgres/contractAndRates/unlockContract.test.ts index d9cbd1aa9d..b3db2e4e95 100644 --- a/services/app-api/src/postgres/contractAndRates/unlockContract.test.ts +++ b/services/app-api/src/postgres/contractAndRates/unlockContract.test.ts @@ -6,7 +6,7 @@ import { unlockContract } from './unlockContract' import { insertDraftRate } from './insertRate' import { unlockRate } from './unlockRate' import { submitRate } from './submitRate' -import { updateDraftContract } from './updateDraftContract' +import { updateDraftContractWithRates } from './updateDraftContractWithRates' import { updateDraftRate } from './updateDraftRate' import { submitContract } from './submitContract' import { findContractWithHistory } from './findContractWithHistory' @@ -59,7 +59,7 @@ describe('unlockContract', () => { // Connect draft contract to submitted rate must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -164,7 +164,7 @@ describe('unlockContract', () => { // Connect draft contract to submitted rate must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -268,7 +268,7 @@ describe('unlockContract', () => { // Connect draft contract to draft rate must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -312,7 +312,7 @@ describe('unlockContract', () => { ) ) must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: { submissionType: 'CONTRACT_AND_RATES', @@ -378,7 +378,7 @@ describe('unlockContract', () => { // Connect draft contract to submitted rate must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: { submissionType: 'CONTRACT_AND_RATES', diff --git a/services/app-api/src/postgres/contractAndRates/updateDraftContract.test.ts b/services/app-api/src/postgres/contractAndRates/updateDraftContractWithRates.test.ts similarity index 89% rename from services/app-api/src/postgres/contractAndRates/updateDraftContract.test.ts rename to services/app-api/src/postgres/contractAndRates/updateDraftContractWithRates.test.ts index 881d86619e..2eb2e34f95 100644 --- a/services/app-api/src/postgres/contractAndRates/updateDraftContract.test.ts +++ b/services/app-api/src/postgres/contractAndRates/updateDraftContractWithRates.test.ts @@ -1,8 +1,8 @@ import { sharedTestPrismaClient } from '../../testHelpers/storeHelpers' import { insertDraftContract } from './insertContract' import { createInsertContractData, must } from '../../testHelpers' -import type { ContractFormEditable } from './updateDraftContract' -import { updateDraftContract } from './updateDraftContract' +import type { ContractFormEditable } from './updateDraftContractWithRates' +import { updateDraftContractWithRates } from './updateDraftContractWithRates' import { PrismaClientValidationError } from '@prisma/client/runtime/library' import type { ContractType } from '@prisma/client' import type { RateFormDataType } from '../../domain-models/contractAndRates' @@ -10,8 +10,7 @@ import { createInsertRateData } from '../../testHelpers/contractAndRates/rateHel import { v4 as uuidv4 } from 'uuid' import type { RateFormEditable } from './updateDraftRate' import { insertDraftRate } from './insertRate' -import { submitRate } from './submitRate'; -import {unlockRate} from './unlockRate'; +import { submitRate } from './submitRate' describe('updateDraftContract', () => { afterEach(() => { @@ -35,7 +34,7 @@ describe('updateDraftContract', () => { submissionDescription: 'something else', } const draft = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm2, }) @@ -103,7 +102,7 @@ describe('updateDraftContract', () => { ) const draft1 = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm1, }) @@ -113,7 +112,7 @@ describe('updateDraftContract', () => { expect(draft1.draftRevision?.formData.contractDocuments).toHaveLength(1) const draft2 = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm2, }) @@ -131,7 +130,7 @@ describe('updateDraftContract', () => { ) const draft3 = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm3, }) @@ -185,7 +184,7 @@ describe('updateDraftContract', () => { ) const draft1 = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm1, }) @@ -194,7 +193,7 @@ describe('updateDraftContract', () => { expect(draft1.draftRevision?.formData.stateContacts).toHaveLength(1) const draft2 = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm2, }) @@ -208,7 +207,7 @@ describe('updateDraftContract', () => { ) const draft3 = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contract.id, formData: draftContractForm3, }) @@ -230,7 +229,7 @@ describe('updateDraftContract', () => { await insertDraftContract(client, draftContractInsert) ) // use type coercion to pass in bad data - const updatedRate = await updateDraftContract(client, { + const updatedRate = await updateDraftContractWithRates(client, { contractID: newRate.id, formData: { submissionDescription: 'a new contract', @@ -247,7 +246,7 @@ describe('updateDraftContract', () => { const client = await sharedTestPrismaClient() - const draftContract = await updateDraftContract(client, { + const draftContract = await updateDraftContractWithRates(client, { contractID: 'not-real-id', formData: { submissionDescription: 'a new contract', @@ -286,7 +285,7 @@ describe('updateDraftContract', () => { // Update contract with new rates const updatedContractWithNewRates = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: draftContract.id, formData: {}, rateFormDatas: newRates, @@ -371,7 +370,7 @@ describe('updateDraftContract', () => { // Update many rates in the contract const updatedContractRates = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: updatedContractWithNewRates.id, formData: {}, rateFormDatas: updateRateRevisionData, @@ -431,7 +430,7 @@ describe('updateDraftContract', () => { // disconnect rate 3 const contractAfterRateDisconnection = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: updatedContractRates.id, formData: {}, rateFormDatas: [ @@ -448,7 +447,7 @@ describe('updateDraftContract', () => { // Create, Update and Disconnect many contracts const contractAfterManyCrud = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: contractAfterRateDisconnection.id, formData: {}, // create two new rates @@ -603,7 +602,7 @@ describe('updateDraftContract', () => { // update draft contract with rates const updatedDraftContract = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: draftContract.id, formData: {}, rateFormDatas: [ @@ -619,7 +618,7 @@ describe('updateDraftContract', () => { ) }) - it('errors when trying to update a submitted rate', async () => { + it('connects submitted rate to draft contract revision without updating rate', async () => { const client = await sharedTestPrismaClient() const stateUser = await client.user.create({ @@ -646,7 +645,7 @@ describe('updateDraftContract', () => { // Update contract with new rates const updatedContractWithNewRates = must( - await updateDraftContract(client, { + await updateDraftContractWithRates(client, { contractID: draftContract.id, formData: {}, rateFormDatas: [newRate], @@ -669,7 +668,7 @@ describe('updateDraftContract', () => { ) } - // expect 1 rates + // expect 1 rate expect(newlyCreatedRates).toHaveLength(1) // submit rate @@ -682,27 +681,54 @@ describe('updateDraftContract', () => { ) ) - if (!submittedExistingRate.revisions[0].formData) { + // Create and submit a new rate that is type 'AMENDMENT' + const newDraftRate = must( + await insertDraftRate( + client, + createInsertRateData({ + id: uuidv4(), + rateType: 'AMENDMENT', + }) + ) + ) + + const newSubmittedRate = must( + await submitRate( + client, + newDraftRate.id, + stateUser.id, + 'Rate 2 submit' + ) + ) + + if ( + !submittedExistingRate.revisions[0] || + !newSubmittedRate.revisions[0] + ) { throw new Error( - 'Unexpected error. Rate revisions did not contain rate IDs' + 'Unexpected error. Submitted rates did not contain revisions' ) } // Update contract with submitted rate and try to update the submitted rate revision - const attemptToUpdateSubmittedRate = must(await updateDraftContract( - client, - { + const attemptToUpdateSubmittedRate = must( + await updateDraftContractWithRates(client, { contractID: updatedContractWithNewRates.id, formData: {}, rateFormDatas: [ - // attempt to update the revision data of a submitted rate. + // attempt to update the revision data of a submitted rate 1. { ...submittedExistingRate.revisions[0].formData, rateType: 'AMENDMENT', }, + // Connect submitted rate 2 and try to update the rate data + { + ...newSubmittedRate.revisions[0].formData, + rateType: 'NEW', + }, ], - } - )) + }) + ) if (!attemptToUpdateSubmittedRate.draftRevision) { throw new Error( @@ -710,10 +736,18 @@ describe('updateDraftContract', () => { ) } - // We still expect 1 connected rate - expect(attemptToUpdateSubmittedRate.draftRevision.rateRevisions).toHaveLength(1) + // Expect 2 connected rates + expect( + attemptToUpdateSubmittedRate.draftRevision.rateRevisions + ).toHaveLength(2) - // We expect the rate type to not be changed to 'AMENDMENT' - expect(attemptToUpdateSubmittedRate.draftRevision.rateRevisions[0].formData.rateType).toBe('NEW') + // Expect the first rates data not to have changed + expect( + attemptToUpdateSubmittedRate.draftRevision.rateRevisions[0].formData + ).toEqual(submittedExistingRate.revisions[0].formData) + // Expect the second rate to be connected and data not to be changed + expect( + attemptToUpdateSubmittedRate.draftRevision.rateRevisions[1].formData + ).toEqual(newSubmittedRate.revisions[0].formData) }) }) diff --git a/services/app-api/src/postgres/contractAndRates/updateDraftContract.ts b/services/app-api/src/postgres/contractAndRates/updateDraftContractWithRates.ts similarity index 75% rename from services/app-api/src/postgres/contractAndRates/updateDraftContract.ts rename to services/app-api/src/postgres/contractAndRates/updateDraftContractWithRates.ts index 4c5df62020..adfaa782f2 100644 --- a/services/app-api/src/postgres/contractAndRates/updateDraftContract.ts +++ b/services/app-api/src/postgres/contractAndRates/updateDraftContractWithRates.ts @@ -12,7 +12,6 @@ import { includeDraftRates } from './prismaDraftContractHelpers' import { rateRevisionToDomainModel } from './prismaSharedContractRateHelpers' import type { RateFormEditable } from './updateDraftRate' import { isEqualData } from '../../resolvers/healthPlanPackage/contractAndRates/resolverHelpers' -import {includeFullRate} from './prismaSubmittedRateHelpers'; type ContractFormEditable = Partial @@ -83,7 +82,7 @@ const sortRatesForUpdate = ( // Update the given draft // * can change the set of draftRates // * set the formData -async function updateDraftContract( +async function updateDraftContractWithRates( client: PrismaClient, args: UpdateContractArgsType ): Promise { @@ -160,23 +159,23 @@ async function updateDraftContract( // Find the rate of the revision with only one draft revision const currentRate = rateRevision.id ? await tx.rateTable.findFirst({ - where: { - revisions: { - some: { - id: rateRevision.id - } - } - }, - include: { - // include the single most recent revision that is not submitted - revisions: { - where: { - submitInfoID: null - }, - take: 1 - } - }, - }) + where: { + revisions: { + some: { + id: rateRevision.id, + }, + }, + }, + include: { + // include the single most recent revision that is not submitted + revisions: { + where: { + submitInfoID: null, + }, + take: 1, + }, + }, + }) : undefined // If rate does not exist, we need to create a new rate. @@ -250,50 +249,53 @@ async function updateDraftContract( data: { // if rate is not submitted, we update the revision data, otherwise we only make the // connection to the draft contract revision. - revisions: !isSubmitted ? { - update: { - where: { - id: rateRevision.id, - }, - data: { - rateType: rateRevision.rateType, - rateCapitationType: - rateRevision.rateCapitationType, - rateDateStart: - rateRevision.rateDateStart, - rateDateEnd: - rateRevision.rateDateEnd, - rateDateCertified: - rateRevision.rateDateCertified, - amendmentEffectiveDateStart: - rateRevision.amendmentEffectiveDateStart, - amendmentEffectiveDateEnd: - rateRevision.amendmentEffectiveDateEnd, - rateProgramIDs: - rateRevision.rateProgramIDs, - rateCertificationName: - rateRevision.rateCertificationName, - rateDocuments: { - deleteMany: {}, - create: rateRevision.rateDocuments, - }, - supportingDocuments: { - deleteMany: {}, - create: rateRevision.supportingDocuments, - }, - certifyingActuaryContacts: { - deleteMany: {}, - create: rateRevision.certifyingActuaryContacts, - }, - addtlActuaryContacts: { - deleteMany: {}, - create: rateRevision.addtlActuaryContacts, - }, - actuaryCommunicationPreference: - rateRevision.actuaryCommunicationPreference, - }, - }, - } : undefined, + revisions: !isSubmitted + ? { + update: { + where: { + id: rateRevision.id, + }, + data: { + rateType: + rateRevision.rateType, + rateCapitationType: + rateRevision.rateCapitationType, + rateDateStart: + rateRevision.rateDateStart, + rateDateEnd: + rateRevision.rateDateEnd, + rateDateCertified: + rateRevision.rateDateCertified, + amendmentEffectiveDateStart: + rateRevision.amendmentEffectiveDateStart, + amendmentEffectiveDateEnd: + rateRevision.amendmentEffectiveDateEnd, + rateProgramIDs: + rateRevision.rateProgramIDs, + rateCertificationName: + rateRevision.rateCertificationName, + rateDocuments: { + deleteMany: {}, + create: rateRevision.rateDocuments, + }, + supportingDocuments: { + deleteMany: {}, + create: rateRevision.supportingDocuments, + }, + certifyingActuaryContacts: { + deleteMany: {}, + create: rateRevision.certifyingActuaryContacts, + }, + addtlActuaryContacts: { + deleteMany: {}, + create: rateRevision.addtlActuaryContacts, + }, + actuaryCommunicationPreference: + rateRevision.actuaryCommunicationPreference, + }, + }, + } + : undefined, draftContractRevisions: { connect: { id: currentRev.id, @@ -369,5 +371,5 @@ async function updateDraftContract( } } -export { updateDraftContract } +export { updateDraftContractWithRates } export type { UpdateContractArgsType, ContractFormEditable } diff --git a/services/app-api/src/postgres/postgresStore.ts b/services/app-api/src/postgres/postgresStore.ts index 2c89d0b8e0..ce7699101d 100644 --- a/services/app-api/src/postgres/postgresStore.ts +++ b/services/app-api/src/postgres/postgresStore.ts @@ -51,7 +51,7 @@ import type { ContractType } from '../domain-models/contractAndRates' import { insertDraftContract, findContractWithHistory, - updateDraftContract, + updateDraftContractWithRates, findAllContractsWithHistoryByState, findAllContractsWithHistoryBySubmitInfo, } from './contractAndRates' @@ -145,7 +145,7 @@ type Store = { contractID: string ) => Promise - updateDraftContract: ( + updateDraftContractWithRates: ( args: UpdateContractArgsType ) => Promise @@ -216,7 +216,8 @@ function NewPostgresStore(client: PrismaClient): Store { insertDraftContract: (args) => insertDraftContract(client, args), findContractWithHistory: (args) => findContractWithHistory(client, args), - updateDraftContract: (args) => updateDraftContract(client, args), + updateDraftContractWithRates: (args) => + updateDraftContractWithRates(client, args), findAllContractsWithHistoryByState: (args) => findAllContractsWithHistoryByState(client, args), findAllContractsWithHistoryBySubmitInfo: () => diff --git a/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.test.ts b/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.test.ts index 10ab9a12a0..8b8249b2ae 100644 --- a/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.test.ts +++ b/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.test.ts @@ -707,12 +707,13 @@ describe.each(flagValueTestParameters)( const postgresStore = NewPostgresStore(prismaClient) const failStore = mockStoreThatErrors() - // set our store to error on the updateFormData call, only + // set store error for flag off postgresStore.updateHealthPlanRevision = failStore.updateHealthPlanRevision // set store error for flag on. - postgresStore.updateDraftContract = failStore.updateDraftContract + postgresStore.updateDraftContractWithRates = + failStore.updateDraftContractWithRates const server = await constructTestPostgresServer({ store: postgresStore, diff --git a/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.ts b/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.ts index a4468ba220..0284e35c39 100644 --- a/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.ts +++ b/services/app-api/src/resolvers/healthPlanPackage/updateHealthPlanFormData.ts @@ -198,7 +198,7 @@ export function updateHealthPlanFormDataResolver( } // Update contract draft revision - const updateResult = await store.updateDraftContract({ + const updateResult = await store.updateDraftContractWithRates({ contractID: input.pkgID, formData: { ...unlockedFormData, diff --git a/services/app-api/src/testHelpers/storeHelpers.ts b/services/app-api/src/testHelpers/storeHelpers.ts index 34a8d8f625..64d7164215 100644 --- a/services/app-api/src/testHelpers/storeHelpers.ts +++ b/services/app-api/src/testHelpers/storeHelpers.ts @@ -108,7 +108,7 @@ function mockStoreThatErrors(): Store { return genericError }, - updateDraftContract: async (_ID) => { + updateDraftContractWithRates: async (_ID) => { return genericError }, findAllContractsWithHistoryByState: async (_ID) => {