Skip to content

Commit

Permalink
MCR-3944: ReviewSubmit updated to use contract and rates (#2275)
Browse files Browse the repository at this point in the history
* wip: reviewSubmit added to V2 and contractAndRate mock created for using in storybook

* fix tests for reviewsubmit -> RateDetailsSummarySection

* add V2 version of component, storybook and test for SubmissionTypeSummarySection

* wip push of contractdetailssummarysection and common code helpers

* fixes 99% of the ContractDetailsSummarySectionV2 test

* Add storybook file for contractdetails

* fix contractdetails storybook

* created component, test and storybook for ContactsSummarySection, updated graphql schema to match stateContacts for hpp with titleRole field

* add uploads tables back to rateDetailsSummary add functionality for draft and submitted rates

* wip integrating page

* update file structure so reviewsubmitV2 related files are under reviewsubmit

* code clean up in tests

* fixed issue with fetchContract not being passed the createdAt and updatedAt fields from prisma and the resolver

* remove unneeded console logs

* resolve local test error

* code cleanup, pr fixes

* fix test

* fix ui bug

* additional PR fixes
  • Loading branch information
pearl-truss authored Mar 7, 2024
1 parent d6d44ae commit 36e528d
Show file tree
Hide file tree
Showing 32 changed files with 4,038 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const contractSchema = z.object({
createdAt: z.date(),
updatedAt: z.date(),
status: statusSchema,
createdAt: z.date(),
updatedAt: z.date(),
stateCode: z.string(),
mccrsID: z.string().optional(),
stateNumber: z.number().min(1),
Expand Down
2 changes: 1 addition & 1 deletion services/app-graphql/src/mutations/submitRate.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mutation submitRate($input: SubmitRateInput!) {
submissionDescription
stateContacts {
name,
title
titleRole
email
}
supportingDocuments {
Expand Down
8 changes: 4 additions & 4 deletions services/app-graphql/src/mutations/unlockRate.graphql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fragment rateRevisionFragment on RateRevision {
fragment rateRevisionFragmentForUnlock on RateRevision {
id
createdAt
updatedAt
Expand Down Expand Up @@ -82,7 +82,7 @@ fragment rateRevisionFragment on RateRevision {
submissionDescription
stateContacts {
name,
title
titleRole
email
}
supportingDocuments {
Expand Down Expand Up @@ -143,11 +143,11 @@ mutation unlockRate($input: UnlockRateInput!) {
initiallySubmittedAt

draftRevision {
...rateRevisionFragment
...rateRevisionFragmentForUnlock
}

revisions {
...rateRevisionFragment
...rateRevisionFragmentForUnlock
}
}
}
Expand Down
118 changes: 29 additions & 89 deletions services/app-graphql/src/queries/fetchContract.graphql
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
query fetchContract($input: FetchContractInput!) {
fetchContract(input: $input) {
contract {
id
status
initiallySubmittedAt
stateCode
state {
code
name
programs {
id
name
fullName
}
}

stateNumber
...contractFields

draftRevision {
...contractRevisionFragment
Expand All @@ -25,11 +11,11 @@ query fetchContract($input: FetchContractInput!) {
...rateFields

draftRevision {
...rateRevisionFragment
...rateRevisionFragmentForFetchContract
}

revisions {
...rateRevisionFragment
...rateRevisionFragmentForFetchContract
}
}

Expand All @@ -40,6 +26,26 @@ query fetchContract($input: FetchContractInput!) {
}
}

fragment contractFields on Contract {
id
status
createdAt
updatedAt
initiallySubmittedAt
stateCode
state {
code
name
programs {
id
name
fullName
}
}

stateNumber
}

fragment rateFields on Rate {
id
createdAt
Expand All @@ -59,7 +65,7 @@ fragment rateFields on Rate {
initiallySubmittedAt
}

fragment rateRevisionFragment on RateRevision {
fragment rateRevisionFragmentForFetchContract on RateRevision {
id
createdAt
updatedAt
Expand Down Expand Up @@ -143,7 +149,7 @@ fragment rateRevisionFragment on RateRevision {
submissionDescription
stateContacts {
name
title
titleRole
email
}
supportingDocuments {
Expand Down Expand Up @@ -194,7 +200,7 @@ fragment contractFormDataFragment on ContractFormData {

stateContacts {
name
title
titleRole
email
}

Expand Down Expand Up @@ -236,50 +242,6 @@ fragment contractFormDataFragment on ContractFormData {
modifiedNonRiskPaymentArrangements
}

fragment rateFormDataFragment on RateFormData {
rateType
rateCapitationType
rateDocuments {
name
s3URL
sha256
}
supportingDocuments {
name
s3URL
sha256
}
rateDateStart
rateDateEnd
rateDateCertified
amendmentEffectiveDateStart
amendmentEffectiveDateEnd
rateProgramIDs
rateCertificationName
certifyingActuaryContacts {
id
name
titleRole
email
actuarialFirm
actuarialFirmOther
}
addtlActuaryContacts {
id
name
titleRole
email
actuarialFirm
actuarialFirmOther
}
actuaryCommunicationPreference
packagesWithSharedRateCerts {
packageName
packageId
packageStatus
}
}

fragment contractRevisionFragment on ContractRevision {
id
createdAt
Expand Down Expand Up @@ -316,38 +278,16 @@ fragment packageSubmissionsFragment on ContractPackageSubmission {
...contractRevisionFragment
}
rateRevisions {
...rateRevisionFragment
...rateRevisionFragmentForFetchContract
}
}

fragment submittableRevisionsFields on SubmittableRevision {
... on ContractRevision {
id
createdAt
updatedAt
submitInfo {
...updateInformationFields
}
unlockInfo {
...updateInformationFields
}
formData {
...contractFormDataFragment
}
...contractRevisionFragment
}
... on RateRevision {
id
createdAt
updatedAt
unlockInfo {
...updateInformationFields
}
submitInfo {
...updateInformationFields
}
formData {
...rateFormDataFragment
}
...rateRevisionFragmentForFetchContract
}
}

Expand Down
10 changes: 5 additions & 5 deletions services/app-graphql/src/queries/fetchRate.graphql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fragment rateRevisionFragment on RateRevision {
fragment rateRevisionFragmentForFetchRate on RateRevision {
id
createdAt
updatedAt
Expand Down Expand Up @@ -81,8 +81,8 @@ fragment rateRevisionFragment on RateRevision {
riskBasedContract
submissionDescription
stateContacts {
name
title
name,
titleRole
email
}
supportingDocuments {
Expand Down Expand Up @@ -147,11 +147,11 @@ query fetchRate($input: FetchRateInput!) {
...rateFields

draftRevision {
...rateRevisionFragment
...rateRevisionFragmentForFetchRate
}

revisions {
...rateRevisionFragment
...rateRevisionFragmentForFetchRate
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion services/app-graphql/src/queries/indexRates.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ query indexRates {
submissionDescription
stateContacts {
name,
title
titleRole
email
}
supportingDocuments {
Expand Down
8 changes: 6 additions & 2 deletions services/app-graphql/src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ enum FederalAuthority {
"Contact information for contacting states regarding their submission"
type StateContact {
name: String
title: String
titleRole: String
email: String
}

Expand Down Expand Up @@ -993,7 +993,11 @@ type ContractFormData {
"If contract includes modifications to the length of the contract period"
modifiedLengthOfContract: Boolean
"If contract includes modifications to the non-risk payment arrangements"
modifiedNonRiskPaymentArrangements: Boolean
modifiedNonRiskPaymentArrangements: Boolean,
"If contract has statutory regulatory attestation"
statutoryRegulatoryAttestation: Boolean,
"Description provided for if contract has statutory regulatory attestation"
statutoryRegulatoryAttestationDescription: String
}

"Either new capitation rates (NEW) or updates to previously certified capitation rates (AMENDMENT)"
Expand Down
50 changes: 50 additions & 0 deletions services/app-web/src/common-code/ContractType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { Contract, ContractRevision } from '../gen/gqlClient'

const getContractRev = (contract: Contract): ContractRevision => {
if (contract.draftRevision) {
return contract.draftRevision
} else {
return contract.packageSubmissions[0].contractRevision
}
}
const isContractOnly = (contract: Contract): boolean => {
const contractRev = getContractRev(contract)
return contractRev.formData.submissionType === 'CONTRACT_ONLY'
}


const isBaseContract = (contract: Contract): boolean => {
const contractRev = getContractRev(contract)
return contractRev.formData.contractType === 'BASE'
}

const isContractAmendment = (contract: Contract): boolean => {
const contractRev = getContractRev(contract)
return contractRev.formData.contractType === 'AMENDMENT'
}

const isCHIPOnly = (contract: Contract): boolean => {
const contractRev = getContractRev(contract)
return contractRev.formData.populationCovered === 'CHIP'
}

const isContractAndRates = (contract: Contract): boolean => {
const contractRev = getContractRev(contract)
return contractRev.formData.submissionType === 'CONTRACT_AND_RATES'
}

const isContractWithProvisions = (contract: Contract): boolean =>
isContractAmendment(contract) || (isBaseContract(contract) && !isCHIPOnly(contract))

const isSubmitted = (contract: Contract): boolean =>
contract.status === 'SUBMITTED'

export {
isContractWithProvisions,
isBaseContract,
isContractAmendment,
isCHIPOnly,
isContractOnly,
isContractAndRates,
isSubmitted,
}
Loading

0 comments on commit 36e528d

Please sign in to comment.