-
Notifications
You must be signed in to change notification settings - Fork 9
3776 maintenence Description field for rr #3962
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
Changes from 22 commits
1e5de96
8cb0af5
994c58c
d0cb184
3878a29
3313663
5e18136
35994ee
52dd0b0
dc13de7
12acfbb
af7e756
b0ae073
e19f2d7
483acb2
99d8636
edfdc46
cc7f6f5
9702586
be6c617
81388a0
895cfc5
b144c13
8d039fd
86c3ad9
e5571f3
535ec03
4881d15
5ba3833
e86620f
b561b12
4d055a7
a8893d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "Reimbursement_Request" ADD COLUMN "description" TEXT; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,6 +228,7 @@ export default class ReimbursementRequestService { | |
| * @param accountCodeId the id of the account code the user made | ||
| * @param totalCost the total cost of the reimbursement with tax | ||
| * @param organizationId the organization the user is currently in | ||
| * @param description the description of the reimbursement request | ||
| * @returns the created reimbursement request | ||
| */ | ||
| static async createReimbursementRequest( | ||
|
|
@@ -239,7 +240,8 @@ export default class ReimbursementRequestService { | |
| acccountCodeId: string, | ||
| totalCost: number, | ||
| organization: Organization, | ||
| dateOfExpense?: Date | ||
| dateOfExpense?: Date, | ||
| description?: string | ||
| ): Promise<ReimbursementRequest> { | ||
| if (await userHasPermission(recipient.userId, organization.organizationId, isGuest)) | ||
| throw new AccessDeniedGuestException('create a reimbursement request'); | ||
|
|
@@ -280,7 +282,8 @@ export default class ReimbursementRequestService { | |
| } | ||
| }, | ||
| identifier: numReimbursementRequests + 1, | ||
| organization: { connect: { organizationId: organization.organizationId } } | ||
| organization: { connect: { organizationId: organization.organizationId } }, | ||
| description: description ?? '' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add default and then you don't need to check here |
||
| } | ||
| }); | ||
|
|
||
|
|
@@ -362,6 +365,7 @@ export default class ReimbursementRequestService { | |
| * @param receiptPictures the old receipts that haven't been deleted (new receipts must be separately uploaded) | ||
| * @param submitter the person editing the reimbursement request | ||
| * @param organizationId the organization the user is currently in | ||
| * @param description the updated description of the reimbursement request | ||
| * @returns the edited reimbursement request | ||
| */ | ||
| static async editReimbursementRequest( | ||
|
|
@@ -375,7 +379,8 @@ export default class ReimbursementRequestService { | |
| receiptPictures: ReimbursementReceiptCreateArgs[], | ||
| submitter: User, | ||
| organization: Organization, | ||
| dateOfExpense?: Date | ||
| dateOfExpense?: Date, | ||
| description?: string | ||
| ): Promise<Reimbursement_Request> { | ||
| const oldReimbursementRequest = await prisma.reimbursement_Request.findUnique({ | ||
| where: { reimbursementRequestId: requestId }, | ||
|
|
@@ -414,6 +419,7 @@ export default class ReimbursementRequestService { | |
| where: { reimbursementRequestId: oldReimbursementRequest.reimbursementRequestId }, | ||
| data: { | ||
| dateOfExpense: dateOfExpense ?? null, | ||
| description: description ?? '', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
| indexCodeId, | ||
| totalCost, | ||
| accountCodeId: accountCode.accountCodeId, | ||
|
|
@@ -490,6 +496,7 @@ export default class ReimbursementRequestService { | |
| * @param reimbursementId The id of the reimbursement to be edited | ||
| * @param editor The user editing the reimbursement | ||
| * @param amount The new amount of the reimbursement | ||
| * @param description The new description of the reimbursement | ||
| * @param dateCreated The new date the reimbursement was created | ||
| * @param organizationId The organization the user is currently in | ||
| * @returns The updated reimbursement | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ const EditReimbursementRequestRenderedDefaultValues: React.FC<{ | |
| vendorId: reimbursementRequest.vendor.vendorId, | ||
| indexCodeId: reimbursementRequest.indexCode.indexCodeId, | ||
| dateOfExpense: reimbursementRequest.dateOfExpense ? new Date(reimbursementRequest.dateOfExpense) : undefined, | ||
| description: reimbursementRequest.description ?? '', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
| accountCodeId: reimbursementRequest.accountCode.accountCodeId, | ||
| reimbursementProducts: reimbursementRequest.reimbursementProducts.map((product) => ({ | ||
| reason: (product.reimbursementProductReason as WBSElementData).wbsNum | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Prisma model defines
descriptionas optional (String?), but the shared API type treats it as required. Consider making this columnString @default("")(with a migration that backfills existing nulls) so the API can reliably return a string and stay consistent with the shared types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copilot is correct here