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

Connect QA to Contracts #2027

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Connect QA to Contracts #2027

merged 3 commits into from
Nov 6, 2023

Conversation

macrael
Copy link
Contributor

@macrael macrael commented Nov 1, 2023

Summary

This PR changes Questions to be related to the ContractTable rather than the HPPTable and migrates all existing Questions over to the new table (these only exist in dev/val)

When we add questions to Rates it will add complexity but this PR is pretty simple.

Joy: almost all the code changes were driven by compiler errors.

Related issues

https://qmacbis.atlassian.net/browse/MCR-2640

QA guidance

Should be able to create questions in environments with the db refactor (which is all of them now)

Copy link
Contributor

@JasonLin0991 JasonLin0991 left a comment

Choose a reason for hiding this comment

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

LGTM.

I think we should make rates-db-refactor a prerequisite for cms-questions since this feature no longer works without the refactor.

createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
pkgID String
pkg HealthPlanPackageTable @relation(fields: [pkgID], references: [id])
Copy link
Contributor

Choose a reason for hiding this comment

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

With these changes to Question and HealthPlanPackageTable, would we want to make a migration or drop the Q&A tables? I think this only applies to Val since it is the only environment that has existing Q&A records.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Take a closer look at that migration! All the Questions that were associated with HPP should now be associated with Contracts

ALTER TABLE "Question" ADD CONSTRAINT "Question_contractID_fkey" FOREIGN KEY ("contractID") REFERENCES "ContractTable"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- migrate data over
UPDATE "Question" SET "contractID"="pkgID";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where we copy all the pkgIDs into contractIDs

The way this works is that we don't add the NOT NULL constraint until after we copy this over.
then we can safely drop the pkgID column

rateDateCertified DateTime? @db.Date
amendmentEffectiveDateStart DateTime? @db.Date
amendmentEffectiveDateEnd DateTime? @db.Date
rateProgramIDs String[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm maybe we need to build in prisma formatting into our precommit scripts. I've been noticing these kind of formatting difff on our prisma PRs over the last few months

Copy link
Contributor

@haworku haworku left a comment

Choose a reason for hiding this comment

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

LGTM. Don't forget turning Cypress back on as a follow on here.

@macrael macrael merged commit 29f1e35 into main Nov 6, 2023
27 checks passed
@macrael macrael deleted the wml-connect-qa-to-contracts branch November 6, 2023 23:05
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.

3 participants