-
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 19 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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| Warnings: | ||
|
|
||
| - Made the column `description` on table `Reimbursement_Request` required. This step will fail if there are existing NULL values in that column. | ||
|
|
||
| */ | ||
| -- AlterTable | ||
| ALTER TABLE "Reimbursement_Request" ALTER COLUMN "description" SET NOT NULL; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -701,6 +701,7 @@ model Reimbursement_Request { | |
| dateCreated DateTime @default(now()) | ||
| dateDeleted DateTime? | ||
| dateOfExpense DateTime? | ||
| description String | ||
|
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. we should make this nullable to work with the existing reimbursement requests |
||
| reimbursementStatuses Reimbursement_Status[] | ||
| recipientId String | ||
| recipient User @relation(name: "reimbursementRequestRecipient", fields: [recipientId], references: [userId]) | ||
|
|
||
| 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -626,6 +626,37 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps> | |
| {/* Right Column */} | ||
| <Grid item xs={12} md={6}> | ||
| <Stack spacing={3}> | ||
| {/* 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. could we move this to the bottom of the right column? I'm thinking since the Account Code field is required and Upload Receipts is potentially required, it might be more intuitive to have those first |
||
| <FormControl sx={{ borderRadius: '25px', width: '100%' }}> | ||
| <FormLabel | ||
| sx={{ | ||
| color: '#dd524c', | ||
| textShadow: '1.5px 0 #dd524c', | ||
| letterSpacing: '0.5px', | ||
| textDecoration: 'underline', | ||
| textUnderlineOffset: '3.5px', | ||
| textDecorationThickness: '0.6px', | ||
| fontSize: 'x-large', | ||
| fontWeight: 'bold' | ||
| }} | ||
| > | ||
| Input 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. could we update this to just 'Description'? |
||
| </FormLabel> | ||
| <Controller | ||
| name="description" | ||
| control={control} | ||
| render={({ field: { onChange, value } }) => ( | ||
| <TextField | ||
| value={value || ''} | ||
| onChange={onChange} | ||
| placeholder="Enter Description" | ||
| multiline | ||
| rows={3} | ||
| /> | ||
| )} | ||
| /> | ||
| </FormControl> | ||
|
|
||
| {/* Account Code */} | ||
| <FormControl sx={{ borderRadius: '25px', width: '100%' }}> | ||
| <FormLabel | ||
|
|
||
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.
could we merge these two files into one migration? should work by deleting them and running yarn prisma:migrate again