Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…e-review into mcr-3568-screen-reader-fixes
  • Loading branch information
pearl-truss committed Nov 7, 2023
2 parents b47f858 + 0ff07ed commit ce93578
Show file tree
Hide file tree
Showing 67 changed files with 968 additions and 860 deletions.
2 changes: 0 additions & 2 deletions services/app-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"eta": "^2.0.0",
"graphql": "^16.2.0",
"graphql-scalars": "^1.11.1",
"json2csv": "^5.0.7",
"lodash": "^4.17.21",
"neverthrow": "^6.0.0",
"path-to-regexp": "^6.2.1",
Expand All @@ -71,7 +70,6 @@
"@types/aws-lambda": "^8.10.83",
"@types/glob": "^8.0.0",
"@types/jest": "^29.5.6",
"@types/json2csv": "^5.0.3",
"@types/request": "^2.48.7",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
BEGIN;

ALTER TABLE "Question" ADD COLUMN "contractID" TEXT;

-- AddForeignKey
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";

-- make not nullable, drop pkgID
ALTER TABLE "Question"
ALTER COLUMN "contractID" SET NOT NULL,
DROP CONSTRAINT "Question_pkgID_fkey",
DROP COLUMN "pkgID";

COMMIT;
55 changes: 28 additions & 27 deletions services/app-api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ model HealthPlanPackageTable {
stateCode String
state State @relation(fields: [stateCode], references: [stateCode])
revisions HealthPlanRevisionTable[]
questions Question[]
}

model ProtoMigrationsTable {
Expand Down Expand Up @@ -41,9 +40,11 @@ model ContractTable {
mccrsID String?
stateCode String
state State @relation(fields: [stateCode], references: [stateCode])
state State @relation(fields: [stateCode], references: [stateCode])
stateNumber Int
questions Question[]
revisions ContractRevisionTable[]
// This relationship is a scam. We never call it in our code but Prisma
// requires that there be an inverse to RateRevision.draftContracts which we do use
Expand Down Expand Up @@ -72,8 +73,8 @@ model ContractRevisionTable {
contractID String
contract ContractTable @relation(fields: [contractID], references: [id])
rateRevisions RateRevisionsOnContractRevisionsTable[]
draftRates RateTable[]
rateRevisions RateRevisionsOnContractRevisionsTable[]
draftRates RateTable[]
unlockInfoID String?
unlockInfo UpdateInfoTable? @relation("unlockContractInfo", fields: [unlockInfoID], references: [id])
Expand Down Expand Up @@ -130,21 +131,21 @@ model RateRevisionTable {
submitInfoID String?
submitInfo UpdateInfoTable? @relation("submitRateInfo", fields: [submitInfoID], references: [id], onDelete: Cascade)
rateType RateType?
rateCapitationType RateCapitationType?
rateDocuments RateDocument[]
supportingDocuments RateSupportingDocument[]
rateDateStart DateTime? @db.Date
rateDateEnd DateTime? @db.Date
rateDateCertified DateTime? @db.Date
amendmentEffectiveDateStart DateTime? @db.Date
amendmentEffectiveDateEnd DateTime? @db.Date
rateProgramIDs String[]
rateCertificationName String?
certifyingActuaryContacts ActuaryContact[] @relation(name: "CertifyingActuaryOnRateRevision")
addtlActuaryContacts ActuaryContact[] @relation(name: "AddtlActuaryOnRateRevision")
actuaryCommunicationPreference ActuaryCommunication?
contractsWithSharedRateRevision ContractTable[] @relation(name: "SharedRateRevisions")
rateType RateType?
rateCapitationType RateCapitationType?
rateDocuments RateDocument[]
supportingDocuments RateSupportingDocument[]
rateDateStart DateTime? @db.Date
rateDateEnd DateTime? @db.Date
rateDateCertified DateTime? @db.Date
amendmentEffectiveDateStart DateTime? @db.Date
amendmentEffectiveDateEnd DateTime? @db.Date
rateProgramIDs String[]
rateCertificationName String?
certifyingActuaryContacts ActuaryContact[] @relation(name: "CertifyingActuaryOnRateRevision")
addtlActuaryContacts ActuaryContact[] @relation(name: "AddtlActuaryOnRateRevision")
actuaryCommunicationPreference ActuaryCommunication?
contractsWithSharedRateRevision ContractTable[] @relation(name: "SharedRateRevisions")
}

model RateRevisionsOnContractRevisionsTable {
Expand Down Expand Up @@ -291,12 +292,12 @@ model UserAudit {
}

model Question {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
pkgID String
pkg HealthPlanPackageTable @relation(fields: [pkgID], references: [id])
addedBy User @relation(fields: [addedByUserID], references: [id])
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
contractID String
contract ContractTable @relation(fields: [contractID], references: [id])
addedBy User @relation(fields: [addedByUserID], references: [id])
addedByUserID String
division Division
documents QuestionDocument[]
Expand Down Expand Up @@ -327,10 +328,10 @@ model QuestionResponse {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
question Question @relation(fields: [questionID], references: [id])
addedBy User @relation(fields: [addedByUserID], references: [id])
questionID String
question Question @relation(fields: [questionID], references: [id])
addedByUserID String
addedBy User @relation(fields: [addedByUserID], references: [id])
documents QuestionResponseDocument[]
}

Expand Down
17 changes: 0 additions & 17 deletions services/app-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,6 @@ functions:
method: get
cors: true

reports:
handler: src/handlers/reports.main
events:
- http:
path: reports
method: get
cors: true
authorizer: aws_iam
layers:
- !Ref PrismaClientEngineLambdaLayer
- arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-9-1:1
timeout: 60
vpc:
securityGroupIds:
- ${self:custom.sgId}
subnetIds: ${self:custom.privateSubnets}

otel:
handler: src/handlers/otel_proxy.main
events:
Expand Down
4 changes: 2 additions & 2 deletions services/app-api/src/domain-models/QuestionsType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Document = {

type Question = {
id: string
pkgID: string
contractID: string
createdAt: Date
addedBy: CMSUserType
documents: Document[]
Expand Down Expand Up @@ -40,7 +40,7 @@ type CreateQuestionPayload = {
}

type CreateQuestionInput = {
pkgID: string
contractID: string
documents: Document[]
}

Expand Down
203 changes: 0 additions & 203 deletions services/app-api/src/handlers/reports.ts

This file was deleted.

Loading

0 comments on commit ce93578

Please sign in to comment.