diff --git a/services/app-api/src/domain-models/contractAndRates/contractAndRatesZodSchema.ts b/services/app-api/src/domain-models/contractAndRates/contractAndRatesZodSchema.ts index 4e3a9aa40b..a4c22e1cd9 100644 --- a/services/app-api/src/domain-models/contractAndRates/contractAndRatesZodSchema.ts +++ b/services/app-api/src/domain-models/contractAndRates/contractAndRatesZodSchema.ts @@ -22,7 +22,7 @@ const contractFormDataSchema = z.object({ addtlActuaryCommunicationPreference: actuaryCommunicationTypeSchema.optional(), supportingDocuments: z.array(submissionDocumentSchema), - contractType: contractTypeSchema.optional(), + contractType: contractTypeSchema, contractExecutionStatus: contractExecutionStatusSchema.optional(), contractDocuments: z.array(submissionDocumentSchema), contractDateStart: z.date().optional(), diff --git a/services/app-api/src/domain-models/contractAndRates/parseDomainData.test.ts b/services/app-api/src/domain-models/contractAndRates/parseDomainData.test.ts index 7948a63698..d9f65b3b78 100644 --- a/services/app-api/src/domain-models/contractAndRates/parseDomainData.test.ts +++ b/services/app-api/src/domain-models/contractAndRates/parseDomainData.test.ts @@ -88,15 +88,34 @@ describe('parseDomainData', () => { ) }) describe('parseDraftContractRevision', () => { + it('cant parse valid contract revision with no errors', () => { + const contractRevision = + createContractRevision() as DraftContractRevisionTableWithRelations + expect( + parseDraftContractRevision(contractRevision) + ).not.toBeInstanceOf(Error) + }) const draftContractRevisionsWithInvalidData: { revision: DraftContractRevisionTableWithRelations testDescription: string }[] = [ { revision: createContractRevision({ - programIDs: undefined, + submissionType: undefined, + }) as DraftContractRevisionTableWithRelations, + testDescription: 'invalid submissionType', + }, + { + revision: createContractRevision({ + submissionDescription: undefined, + }) as DraftContractRevisionTableWithRelations, + testDescription: 'invalid submissionDescription', + }, + { + revision: createContractRevision({ + contractType: undefined, }) as DraftContractRevisionTableWithRelations, - testDescription: 'invalid programIDs', + testDescription: 'invalid contractType', }, { revision: createContractRevision({