-
Notifications
You must be signed in to change notification settings - Fork 3
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
MR-3186: migrate indexhpp resolver #1890
Conversation
…dexhpp # Conflicts: # services/app-api/src/postgres/contractAndRates/index.ts # services/app-api/src/postgres/postgresStore.ts # services/app-api/src/testHelpers/storeHelpers.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. ⭐ appreciate the PR write up too for context. All my comments are about file org stuff thinking ahead to when we start building rate only apis and also eventually refactor out the old way of doing things.
@@ -72,8 +72,6 @@ function packageSubmitters(pkg: HealthPlanPackageType): string[] { | |||
function convertContractToUnlockedHealthPlanPackage( | |||
contract: ContractType | |||
): HealthPlanPackageType | Error { | |||
console.info('Attempting to convert contract to health plan package') | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: file organization - this function takes parameter from the rates refactor (ContractType
) whereas everything else in this file is about the domain model HPP and takes HPP related arguments. Should be separate file in domain models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I could see this being in domain-models/contractAndRates
in some file that contains all the converter functions we will have. I think though, I want to punt this to your ticket. I think you have to make converter functions for locked HPP. Maybe you could find a good home and name for this file.
import type { ProgramType } from '../../domain-models' | ||
import statePrograms from 'app-web/src/common-code/data/statePrograms.json' | ||
|
||
function getProgramsFromState(stateCode: StateCodeType): ProgramType[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea for reusable function - I see this code all over.
Nit: file organization - this looks like a stateHelper not a contractHelper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is your reusable function! I just took it and put it in here. I will extract them all out and put them in a stateHelpers.ts
file.
services/app-api/src/resolvers/healthPlanPackage/indexHealthPlanPackages.test.ts
Show resolved
Hide resolved
@@ -39,24 +48,146 @@ const validateAndReturnHealthPlanPackages = ( | |||
return { totalCount: edges.length, edges } | |||
} | |||
|
|||
const validateContractsAndConvert = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: file organization - I'm noticing we never made a contractAndRates
folder in resolvers and I think we should for stuff like this helper. We are eventually building a totally parallel api - want those files to be easy to distinguish.
Summary
MR-3449
todo
at the top of the tests.validateContractsAndConvert
function to validate contract results returned from PrismavalidateContractsAndConvert
function.findAllContractsWithHistoryBySubmitInfo
new Prisma function to get all contracts that have submitted info. This will grab all contracts that are/have been submitted.findAllContractsWithHistoryByState
new Prisma function to get all contracts bystateCode
programIDs
as the state program id and not the name. The frontend uses the id to find the name. Before this all contracts on the submission dashboard would have unknown programs.Related issues
Screenshots
Test cases covered
findAllContractsWithHistoryBySubmitInfo.test.ts
'returns only contracts that have been submitted or unlocked'
indexHealthPlanPackage.test.ts
'correctly filters and log contracts that failed parsing or converting'
QA guidance