-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MCR-3944: ReviewSubmit updated to use contract and rates (#2275)
* 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
1 parent
d6d44ae
commit 36e528d
Showing
32 changed files
with
4,038 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
Oops, something went wrong.