Skip to content

Commit

Permalink
#1893 migration and test data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradford Derby committed Mar 24, 2024
1 parent 73c4c98 commit 4c4547c
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
Warnings:
- A unique constraint covering the columns `[identifier]` on the table `Reimbursement_Request` will be added. If there are existing duplicate values, this will fail.
*/
-- DropForeignKey
ALTER TABLE "_blockedBy" DROP CONSTRAINT "_blockedBy_B_fkey";

Expand All @@ -20,9 +14,6 @@ ADD COLUMN "wpProposedChangesExpectedActivitiesId" TEXT;
-- AlterTable
ALTER TABLE "Link" ADD COLUMN "proposedWbsChangeId" TEXT;

-- AlterTable
ALTER TABLE "Reimbursement_Request" ADD COLUMN "identifier" SERIAL NOT NULL;

-- AlterTable
ALTER TABLE "_blockedBy" ALTER COLUMN "B" SET DATA TYPE TEXT;

Expand Down Expand Up @@ -82,9 +73,6 @@ CREATE UNIQUE INDEX "_proposedProjectTeams_AB_unique" ON "_proposedProjectTeams"
-- CreateIndex
CREATE INDEX "_proposedProjectTeams_B_index" ON "_proposedProjectTeams"("B");

-- CreateIndex
CREATE UNIQUE INDEX "Reimbursement_Request_identifier_key" ON "Reimbursement_Request"("identifier");

-- AddForeignKey
ALTER TABLE "Link" ADD CONSTRAINT "Link_proposedWbsChangeId_fkey" FOREIGN KEY ("proposedWbsChangeId") REFERENCES "Wbs_Proposed_Changes"("wbsProposedChangesId") ON DELETE SET NULL ON UPDATE CASCADE;

Expand Down
185 changes: 98 additions & 87 deletions src/backend/tests/test-data/change-requests.test-data.ts
Original file line number Diff line number Diff line change
@@ -1,87 +1,98 @@
import {
Change_Request as PrismaChangeRequest,
Proposed_Solution as PrismaProposedSolution,
Scope_CR as PrismaScopeCR,
Description_Bullet as PrismaDescriptionBullet,
CR_Type as PrismaCRType
} from '@prisma/client';
import { ChangeRequest as SharedChangeRequest, ChangeRequestStatus, ChangeRequestType } from 'shared';
import { sharedBatman } from './users.test-data';

export const prismaChangeRequest1: PrismaChangeRequest = {
crId: 1,
submitterId: 1,
wbsElementId: 65,
type: PrismaCRType.DEFINITION_CHANGE,
dateSubmitted: new Date('11/24/2020'),
dateReviewed: new Date('11/25/2020'),
accepted: null,
reviewerId: null,
reviewNotes: null,
dateDeleted: null,
deletedByUserId: null
};

export const prismaProposedSolution1: PrismaProposedSolution = {
proposedSolutionId: '1',
description: 'Change Color from Orange to Black',
timelineImpact: 10,
budgetImpact: 1000,
scopeImpact: 'huge',
changeRequestId: 1,
createdByUserId: 3,
dateCreated: new Date('10/16/2022'),
approved: false
};

export const prismaScopeChangeRequest1: PrismaScopeCR = {
scopeCrId: 1,
changeRequestId: 2,
what: 'redesign whip',
scopeImpact: 'huge',
timelineImpact: 10,
budgetImpact: 1000
};

export const whipExpectedActivites: PrismaDescriptionBullet = {
descriptionId: 1,
dateAdded: new Date('10/10/2022'),
userCheckedId: 1,
dateTimeChecked: new Date('10/10/2022'),
dateDeleted: null,
projectIdGoals: null,
projectIdFeatures: null,
projectIdOtherConstraints: null,
workPackageIdDeliverables: null,
detail: 'redesign whip',
workPackageIdExpectedActivities: 1
};

export const whipDeliverables: PrismaDescriptionBullet = {
descriptionId: 2,
dateAdded: new Date('10/10/2022'),
userCheckedId: 1,
dateTimeChecked: new Date('10/10/2022'),
detail: 'Gotta Finish',
workPackageIdDeliverables: 1,
projectIdGoals: null,
projectIdFeatures: null,
projectIdOtherConstraints: null,
workPackageIdExpectedActivities: null,
dateDeleted: null
};

export const sharedChangeRequest: SharedChangeRequest = {
crId: 1,
wbsNum: {
carNumber: 1,
projectNumber: 2,
workPackageNumber: 3
},
wbsName: 'whip',
submitter: sharedBatman,
dateSubmitted: new Date('12-25-2000'),
type: ChangeRequestType.Redefinition,
status: ChangeRequestStatus.Open,
requestedReviewers: []
};
import {
Change_Request as PrismaChangeRequest,
Proposed_Solution as PrismaProposedSolution,
Scope_CR as PrismaScopeCR,
Description_Bullet as PrismaDescriptionBullet,
CR_Type as PrismaCRType
} from '@prisma/client';
import { ChangeRequest as SharedChangeRequest, ChangeRequestStatus, ChangeRequestType } from 'shared';
import { sharedBatman } from './users.test-data';

export const prismaChangeRequest1: PrismaChangeRequest = {
crId: 1,
submitterId: 1,
wbsElementId: 65,
type: PrismaCRType.DEFINITION_CHANGE,
dateSubmitted: new Date('11/24/2020'),
dateReviewed: new Date('11/25/2020'),
accepted: null,
reviewerId: null,
reviewNotes: null,
dateDeleted: null,
deletedByUserId: null,
wbsProposedChangesId: null
};

export const prismaProposedSolution1: PrismaProposedSolution = {
proposedSolutionId: '1',
description: 'Change Color from Orange to Black',
timelineImpact: 10,
budgetImpact: 1000,
scopeImpact: 'huge',
changeRequestId: 1,
createdByUserId: 3,
dateCreated: new Date('10/16/2022'),
approved: false
};

export const prismaScopeChangeRequest1: PrismaScopeCR = {
scopeCrId: 1,
changeRequestId: 2,
what: 'redesign whip',
scopeImpact: 'huge',
timelineImpact: 10,
budgetImpact: 1000
};

export const whipExpectedActivites: PrismaDescriptionBullet = {
descriptionId: 1,
dateAdded: new Date('10/10/2022'),
userCheckedId: 1,
dateTimeChecked: new Date('10/10/2022'),
dateDeleted: null,
projectIdGoals: null,
projectIdFeatures: null,
projectIdOtherConstraints: null,
workPackageIdDeliverables: null,
detail: 'redesign whip',
workPackageIdExpectedActivities: 1,
proposedProjectChangesGoalsId: null,
proposedProjectChangesFeaturesId: null,
proposedProjectChangesOtherConstraintsId: null,
wpProposedChangesExpectedActivitiesId: null,
wpProposedChangesDeliverablesId: null
};

export const whipDeliverables: PrismaDescriptionBullet = {
descriptionId: 2,
dateAdded: new Date('10/10/2022'),
userCheckedId: 1,
dateTimeChecked: new Date('10/10/2022'),
detail: 'Gotta Finish',
workPackageIdDeliverables: 1,
projectIdGoals: null,
projectIdFeatures: null,
projectIdOtherConstraints: null,
workPackageIdExpectedActivities: null,
dateDeleted: null,
proposedProjectChangesGoalsId: null,
proposedProjectChangesFeaturesId: null,
proposedProjectChangesOtherConstraintsId: null,
wpProposedChangesExpectedActivitiesId: null,
wpProposedChangesDeliverablesId: null
};

export const sharedChangeRequest: SharedChangeRequest = {
crId: 1,
wbsNum: {
carNumber: 1,
projectNumber: 2,
workPackageNumber: 3
},
wbsName: 'whip',
submitter: sharedBatman,
dateSubmitted: new Date('12-25-2000'),
type: ChangeRequestType.Redefinition,
status: ChangeRequestStatus.Open,
requestedReviewers: []
};

0 comments on commit 4c4547c

Please sign in to comment.