Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract + Rates shared history #2349

Merged
merged 24 commits into from
Apr 18, 2024
Merged

Contract + Rates shared history #2349

merged 24 commits into from
Apr 18, 2024

Conversation

macrael
Copy link
Contributor

@macrael macrael commented Apr 1, 2024

Summary

Contract + Rates Submission

This PR implements submission and returns the package submission history for submitted contracts and rates.

Submission submits the contract and any unsubmitted rates. We use the design described in Notion to write to the assorted tables on submit that then get read from in fetchContract.

Related issues

https://jiraent.cms.gov/browse/MCR-3942
https://jiraent.cms.gov/browse/MCR-3966

Screenshots

Test cases covered

MANY TESTS HAVE CHANGED

because I moved the logic for submitting rates into contracts, and because we have to keep track of parent contracts, the API no longer allows a rate to be submitted initially on its own. Many tests had to change to follow the rule that a rate is always initially submitted with a specific contract.

QA guidance

If you can make something break by submitting linked rates, please write a test case! I'm still working on a few more.

return firstError
} else {
const allDraftRates: RateType[] =
draftRatesOrError as RateType[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really intend to do this type coercion where an Error is deemed Rate Type list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I just checked that it wasn't an Error above. But I think I'll pull this out into its own function.

})
}
}
// if (updateResult.draftRevision.rateRevisions.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being implemented on the other PR that will merge into this? Assuming we would not want to merge as is since it turns off some of the submit rates functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the logic into the submit rates postgres handler, I'll clean up this dead code

- Attempt to find state programs from json file returns an error
- INVALID_PACKAGE_STATUS
- Attempted to submit a package in the SUBMITTED or RESUBMITTED state
- PROTO_DECODE_ERROR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^Please check this comment block - some info in here is incurrate

@@ -1281,6 +1325,8 @@ type Rate {
This value is used to generate the rateName
"""
stateNumber: Int!
"parentContractID is the ID of the contract that initially submitted this rate"
parentContractID: ID!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the domain models need these updates as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be updated now

@@ -0,0 +1,27 @@
import { packageName } from 'app-web/src/common-code/healthPlanFormDataType'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the frontend I get an auth error (signing in doesn't go through) Check Auth Failed. ApolloError: Response not successful: Received status code 502. Until this path is updated to a relative on2 ../../../../app-web/src/common-code/healthPlanFormDataType

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a fix for that, I can log in locally lmk if you still can't

@macrael macrael marked this pull request as ready for review April 15, 2024 20:53
return domainRevisions
}

function unsortedRatesRevisionsToDomainModel(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems misnamed now- it looks like we are sorting before we feed into this function and what this function is doing is just changing those sorted rate revisions from prisma to domain model types

Copy link
Contributor

@pearl-truss pearl-truss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this by bringing it into my branch and it looks good

@pearl-truss
Copy link
Contributor

@macrael one thing I'm seeing now is contract.initiallySubmittedAt is null when fetchContract is used. (I updated the ReviewSubmitV2 page to use submitContract in my branch this morning)

@macrael macrael merged commit 6f305d0 into main Apr 18, 2024
27 of 28 checks passed
@macrael macrael deleted the wml-db-history branch April 18, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants