Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- AlterTable
ALTER TABLE "Sponsor" ADD COLUMN "logoImageId" TEXT;

-- CreateTable
CREATE TABLE "Guest_Definition" (
"definitionId" TEXT NOT NULL,
"term" TEXT NOT NULL,
"description" TEXT NOT NULL,
"order" INTEGER NOT NULL,
"buttonText" TEXT,
"buttonLink" TEXT,
"icon" TEXT,
"dateCreated" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"dateDeleted" TIMESTAMP(3),
"userDeletedId" TEXT,
"userCreatedId" TEXT NOT NULL,
"organizationId" TEXT NOT NULL,

CONSTRAINT "Guest_Definition_pkey" PRIMARY KEY ("definitionId")
);

-- CreateIndex
CREATE INDEX "Guest_Definition_organizationId_idx" ON "Guest_Definition"("organizationId");

-- AddForeignKey
ALTER TABLE "Guest_Definition" ADD CONSTRAINT "Guest_Definition_userDeletedId_fkey" FOREIGN KEY ("userDeletedId") REFERENCES "User"("userId") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Guest_Definition" ADD CONSTRAINT "Guest_Definition_userCreatedId_fkey" FOREIGN KEY ("userCreatedId") REFERENCES "User"("userId") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Guest_Definition" ADD CONSTRAINT "Guest_Definition_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("organizationId") ON DELETE RESTRICT ON UPDATE CASCADE;
24 changes: 24 additions & 0 deletions src/backend/src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ model User {
deletedSponsorTiers Sponsor_Tier[]
financeDelegateForOrganizations Organization[] @relation(name: "financeDelegates")
assignedReimbursementRequests Reimbursement_Request[] @relation(name: "reimbursementRequestAssignee")
deletedGuestDefinitions Guest_Definition[] @relation(name: "guestDefinitionDeleter")
createdGuestDefinitions Guest_Definition[] @relation(name: "guestDefinitionCreator")
}

model Role {
Expand Down Expand Up @@ -796,6 +798,7 @@ model Sponsor {
activeYears Int[]
taxExempt Boolean
sponsorTasks Sponsor_Task[]
logoImageId String?

@@unique([name, organizationId], name: "uniqueSponsor")
@@index([sponsorTierId])
Expand Down Expand Up @@ -1218,6 +1221,7 @@ model Organization {
sponsorTiers Sponsor_Tier[]
indexCodes Index_Code[]
financeDelegates User[] @relation(name: "financeDelegates")
guestDefinitions Guest_Definition[]
}

model FrequentlyAskedQuestion {
Expand Down Expand Up @@ -1555,3 +1559,23 @@ model Reimbursement_Request_Comment {

@@index([reimbursementRequestId])
}

model Guest_Definition {
definitionId String @id @default(uuid())
term String
description String
order Int
buttonText String?
buttonLink String?
icon String?
dateCreated DateTime @default(now())
dateDeleted DateTime?
userDeleted User? @relation(fields: [userDeletedId], references: [userId], name: "guestDefinitionDeleter")
userDeletedId String?
userCreated User @relation(fields: [userCreatedId], references: [userId], name: "guestDefinitionCreator")
userCreatedId String
organization Organization @relation(fields: [organizationId], references: [organizationId])
organizationId String

@@index([organizationId])
}
2 changes: 1 addition & 1 deletion src/backend/tests/unit/team-type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Team Type Tests', () => {
organization
);

expect(result).toEqual({
expect(result).toMatchObject({
name: 'teamType3',
iconName: 'YouTubeIcon',
organizationId: orgId,
Expand Down
2 changes: 1 addition & 1 deletion src/backend/tests/unmocked/team-type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Team Type Tests', () => {
organization
);

expect(result).toEqual({
expect(result).toMatchObject({
name: 'teamType3',
iconName: 'YouTubeIcon',
description: '',
Expand Down