Skip to content

Commit d6f0b0f

Browse files
committed
merge with develop
2 parents 7266798 + 10c328b commit d6f0b0f

20 files changed

Lines changed: 209 additions & 54 deletions

File tree

src/backend/src/controllers/finance.controllers.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export default class FinanceController {
1414
taxExempt,
1515
sponsorContact,
1616
sponsorTasks,
17-
discountCode
17+
discountCode,
18+
sponsorNotes
1819
} = req.body;
1920

2021
const sponsor = await FinanceServices.createSponsor(
@@ -29,7 +30,8 @@ export default class FinanceController {
2930
sponsorContact,
3031
sponsorTasks,
3132
req.organization,
32-
discountCode
33+
discountCode,
34+
sponsorNotes
3335
);
3436
res.status(200).json(sponsor);
3537
} catch (error: unknown) {
@@ -328,7 +330,8 @@ export default class FinanceController {
328330
sponsorContact,
329331
taxExempt,
330332
sponsorTasks,
331-
discountCode
333+
discountCode,
334+
sponsorNotes
332335
} = req.body;
333336

334337
const updatedSponsor = await FinanceServices.editSponsor(
@@ -344,7 +347,8 @@ export default class FinanceController {
344347
sponsorContact,
345348
taxExempt,
346349
sponsorTasks,
347-
discountCode
350+
discountCode,
351+
sponsorNotes
348352
);
349353

350354
res.status(200).json(updatedSponsor);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "Sponsor" ADD COLUMN "sponsorNotes" TEXT;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- AlterTable
2+
ALTER TABLE "Sponsor" ADD COLUMN "logoImageId" TEXT;
3+
4+
-- CreateTable
5+
CREATE TABLE "Guest_Definition" (
6+
"definitionId" TEXT NOT NULL,
7+
"term" TEXT NOT NULL,
8+
"description" TEXT NOT NULL,
9+
"order" INTEGER NOT NULL,
10+
"buttonText" TEXT,
11+
"buttonLink" TEXT,
12+
"icon" TEXT,
13+
"dateCreated" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
14+
"dateDeleted" TIMESTAMP(3),
15+
"userDeletedId" TEXT,
16+
"userCreatedId" TEXT NOT NULL,
17+
"organizationId" TEXT NOT NULL,
18+
19+
CONSTRAINT "Guest_Definition_pkey" PRIMARY KEY ("definitionId")
20+
);
21+
22+
-- CreateIndex
23+
CREATE INDEX "Guest_Definition_organizationId_idx" ON "Guest_Definition"("organizationId");
24+
25+
-- AddForeignKey
26+
ALTER TABLE "Guest_Definition" ADD CONSTRAINT "Guest_Definition_userDeletedId_fkey" FOREIGN KEY ("userDeletedId") REFERENCES "User"("userId") ON DELETE SET NULL ON UPDATE CASCADE;
27+
28+
-- AddForeignKey
29+
ALTER TABLE "Guest_Definition" ADD CONSTRAINT "Guest_Definition_userCreatedId_fkey" FOREIGN KEY ("userCreatedId") REFERENCES "User"("userId") ON DELETE RESTRICT ON UPDATE CASCADE;
30+
31+
-- AddForeignKey
32+
ALTER TABLE "Guest_Definition" ADD CONSTRAINT "Guest_Definition_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("organizationId") ON DELETE RESTRICT ON UPDATE CASCADE;

src/backend/src/prisma/schema.prisma

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ model User {
270270
deletedSponsorTiers Sponsor_Tier[]
271271
financeDelegateForOrganizations Organization[] @relation(name: "financeDelegates")
272272
assignedReimbursementRequests Reimbursement_Request[] @relation(name: "reimbursementRequestAssignee")
273+
deletedGuestDefinitions Guest_Definition[] @relation(name: "guestDefinitionDeleter")
274+
createdGuestDefinitions Guest_Definition[] @relation(name: "guestDefinitionCreator")
273275
requiredEvents Event[] @relation(name: "requiredEventAttendee")
274276
optionalEvents Event[] @relation(name: "optionalEventAttendee")
275277
confirmedEvents Event[] @relation(name: "confirmedEventAttendee")
@@ -805,7 +807,9 @@ model Sponsor {
805807
discountCode String?
806808
activeYears Int[]
807809
taxExempt Boolean
810+
sponsorNotes String?
808811
sponsorTasks Sponsor_Task[]
812+
logoImageId String?
809813
810814
@@unique([name, organizationId], name: "uniqueSponsor")
811815
@@index([sponsorTierId])
@@ -1353,6 +1357,7 @@ model Organization {
13531357
sponsorTiers Sponsor_Tier[]
13541358
indexCodes Index_Code[]
13551359
financeDelegates User[] @relation(name: "financeDelegates")
1360+
guestDefinitions Guest_Definition[]
13561361
shops Shop[]
13571362
machineries Machinery[]
13581363
calendars Calendar[]
@@ -1694,3 +1699,23 @@ model Reimbursement_Request_Comment {
16941699
16951700
@@index([reimbursementRequestId])
16961701
}
1702+
1703+
model Guest_Definition {
1704+
definitionId String @id @default(uuid())
1705+
term String
1706+
description String
1707+
order Int
1708+
buttonText String?
1709+
buttonLink String?
1710+
icon String?
1711+
dateCreated DateTime @default(now())
1712+
dateDeleted DateTime?
1713+
userDeleted User? @relation(fields: [userDeletedId], references: [userId], name: "guestDefinitionDeleter")
1714+
userDeletedId String?
1715+
userCreated User @relation(fields: [userCreatedId], references: [userId], name: "guestDefinitionCreator")
1716+
userCreatedId String
1717+
organization Organization @relation(fields: [organizationId], references: [organizationId])
1718+
organizationId String
1719+
1720+
@@index([organizationId])
1721+
}

src/backend/src/services/change-requests.services.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,9 +781,7 @@ export default class ChangeRequestsService {
781781
descriptionBullets: true,
782782
changeRequests: {
783783
where: {
784-
dateDeleted: {
785-
not: null
786-
}
784+
dateDeleted: null
787785
},
788786
include: { changes: true }
789787
}
@@ -883,7 +881,7 @@ export default class ChangeRequestsService {
883881
where: {
884882
otherReimbursementProductReasonId: otherReasonId
885883
},
886-
include: { changeRequests: { where: { dateDeleted: { not: null } }, include: { changes: true } } }
884+
include: { changeRequests: { where: { dateDeleted: null }, include: { changes: true } } }
887885
});
888886

889887
if (!category) throw new NotFoundException('Reimbursement Product Other Reason', otherReasonId);
@@ -946,7 +944,7 @@ export default class ChangeRequestsService {
946944
where: {
947945
accountCodeId
948946
},
949-
include: { changeRequests: { where: { dateDeleted: { not: null } }, include: { changes: true } } }
947+
include: { changeRequests: { where: { dateDeleted: null }, include: { changes: true } } }
950948
});
951949

952950
if (!accountCode) throw new NotFoundException('Account Code', accountCodeId);

src/backend/src/services/finance.services.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default class FinanceServices {
4848
* @param sponsorTierId The ID of the sponsor's tier.
4949
* @param taxExempt Boolean indicating if the sponsor is tax-exempt.
5050
* @param discountCode The discount code associated with the sponsor.
51+
* @param sponsorNotes Additional notes about the sponsor.
5152
* @param sponsorContact The contact information for the sponsor.
5253
* @param sponsorTasks An array of sponsor tasks associated with the sponsor.
5354
* @param organization The organization for which the sponsor is being created.
@@ -68,7 +69,8 @@ export default class FinanceServices {
6869
sponsorContact: string,
6970
sponsorTasks: CreateSponsorTask[],
7071
organization: Organization,
71-
discountCode?: string
72+
discountCode?: string,
73+
sponsorNotes?: string
7274
) {
7375
if (!(await userHasPermission(submitter.userId, organization.organizationId, isHead)))
7476
throw new AccessDeniedException('Only heads can create a sponsor');
@@ -94,6 +96,7 @@ export default class FinanceServices {
9496
sponsorTierId,
9597
taxExempt,
9698
discountCode,
99+
sponsorNotes,
97100
vendorContact: sponsorContact,
98101
sponsorTasks: {
99102
create: sponsorTasks.map((task) => ({
@@ -1102,6 +1105,7 @@ export default class FinanceServices {
11021105
* @param sponsorTierId The ID of the sponsor's tier.
11031106
* @param taxExempt Boolean indicating if the sponsor is tax-exempt.
11041107
* @param discountCode The discount code associated with the sponsor.
1108+
* @param sponsorNotes Additional notes about the sponsor.
11051109
* @param sponsorContact The contact information for the sponsor.
11061110
* @param sponsorTasks An array of sponsor tasks associated with the sponsor.
11071111
* @param organization The organization for which the sponsor is being edited.
@@ -1121,7 +1125,8 @@ export default class FinanceServices {
11211125
sponsorContact: string,
11221126
taxExempt: boolean,
11231127
sponsorTasks: CreateSponsorTask[],
1124-
discountCode?: string
1128+
discountCode?: string,
1129+
sponsorNotes?: string
11251130
): Promise<Sponsor> {
11261131
if (!(await userHasPermission(submitter.userId, organization.organizationId, isHead)))
11271132
throw new AccessDeniedException('Only heads can edit sponsors.');
@@ -1202,7 +1207,8 @@ export default class FinanceServices {
12021207
},
12031208
vendorContact: sponsorContact,
12041209
taxExempt,
1205-
discountCode
1210+
discountCode,
1211+
sponsorNotes
12061212
},
12071213
...getSponsorQueryArgs(organization.organizationId)
12081214
});

src/backend/src/services/notifications.services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export default class NotificationsService {
204204

205205
return (
206206
`${usersToSlackPings(event.attendees ?? [])} ${event.title} (${workPackageNames}) ` +
207-
`will be having an event today at ${meetingStartTimePipeNumbers(meetingTimes)}! ` +
207+
`will be having an event today at ${meetingStartTimePipeNumbers(meetingTimes)} EST! ` +
208208
zoomLink +
209209
questionDocLink
210210
);

src/backend/src/transformers/finance.transformer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const sponsorTransformer = (sponsor: Prisma.SponsorGetPayload<SponsorQuer
77
return {
88
...sponsor,
99
sponsorContact: sponsor.vendorContact,
10+
sponsorNotes: sponsor.sponsorNotes ?? undefined,
1011
discountCode: sponsor.discountCode ?? undefined,
1112
sponsorTasks: sponsor.sponsorTasks.map(sponsorTaskTranformer)
1213
};

src/backend/tests/unit/team-type.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('Team Type Tests', () => {
5959
organization
6060
);
6161

62-
expect(result).toEqual({
62+
expect(result).toMatchObject({
6363
name: 'teamType3',
6464
iconName: 'YouTubeIcon',
6565
organizationId: orgId,

src/backend/tests/unmocked/team-type.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('Team Type Tests', () => {
7777
organization
7878
);
7979

80-
expect(result).toEqual({
80+
expect(result).toMatchObject({
8181
name: 'teamType3',
8282
iconName: 'YouTubeIcon',
8383
description: '',

0 commit comments

Comments
 (0)