#3271: club account and product purchase other reason now a model#3281
#3271: club account and product purchase other reason now a model#3281wavehassman merged 33 commits intofeature/finance-redesignfrom
Conversation
Peyton-McKee
left a comment
There was a problem hiding this comment.
Generally i would refactor the migration to look something like this
Change account to indexCode in RR Model
Create the Index Code Table, Create the Other Reimbursement Reason Table,
Create new Admin user
Insert each cash and budget into index code table and use admin user id as the user who created
Insert each other reimbursement reason into reimbursement table with admin as the creator
iterate over every rr and if rr.account === indexCode.name, set rr.indexCodeId = indexCode.indexCodeId, yk, and do something similar for whatever uses other reimbursement reason
src/backend/src/prisma/migrations/20250127014440_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
src/backend/src/prisma/migrations/20250127014440_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
src/backend/src/prisma/migrations/20250127014440_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
src/backend/src/prisma/migrations/20250127014440_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
src/backend/src/prisma/migrations/20250127014440_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
src/backend/src/prisma/migrations/20250127014440_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
dreifusjack
left a comment
There was a problem hiding this comment.
I was only able to review the frontend and endpoints bc you know more than me on the db stuff. Overall everything looks great! Just added some small fixes. Also I noticed that the getAllIndexCode endpoint ensures the user is an admin or on the finance team, but not the getSingleIndexCode, just want to confirm that one should be validating and the other not. Same goes for the getSingleOtherR... and getAllSingleOtherR...
src/backend/src/prisma/migrations/20250321005151_finance_redesign/migration.sql
Outdated
Show resolved
Hide resolved
| @@ -201,27 +202,27 @@ const getTotalAmountOwedForCashAndBudgetForSubmittedToSaboAndPendingFinanceTeam | |||
| ); | |||
|
|
|||
| const totalAmountOwedForCashSabo = submittedToSabo.reduce((acc, curr) => { | |||
There was a problem hiding this comment.
Assuming other organizations won't have the exact same accounts as us, this will have to be reworked. You should make it another ticket but it def needs to be done
There was a problem hiding this comment.
How would someone go about this like high level? Trying to write up a ticket and am stuck
There was a problem hiding this comment.
Oh actually I didn't realize this was the manual file, don't worry about it
|
|
||
| export const isAccount = (validationObject: ValidationChain): ValidationChain => { | ||
| return validationObject.isString().isIn([ClubAccount.BUDGET, ClubAccount.CASH]); | ||
| return validationObject.isString().isIn(['Budget', 'Cash']); |
There was a problem hiding this comment.
This only works for these two accounts. If there are more, we need to check against an org's list of accounts
There was a problem hiding this comment.
Since this is now a model, I changed the create and edit reimbursement request endpoints to now take in indexCodeIds instead of the whole model, so this isn't even used now.
uncomment seed
seed and project route
| @@ -201,27 +202,27 @@ const getTotalAmountOwedForCashAndBudgetForSubmittedToSaboAndPendingFinanceTeam | |||
| ); | |||
|
|
|||
| const totalAmountOwedForCashSabo = submittedToSabo.reduce((acc, curr) => { | |||
There was a problem hiding this comment.
Oh actually I didn't realize this was the manual file, don't worry about it
| @@ -1,4 +1,4 @@ | |||
| import { ClubAccount, ReimbursementRequest } from 'shared'; | |||
There was a problem hiding this comment.
This modal needs to be reworked to use non-predermined accounts and codes. You can make that a seperate ticket if you'd like
Changes
I made Club_Account and Reimbursment_Product_Other_Reason models. This caused a bunch of errors in the frontend and backend, so I had to go and fix those.
Notes
In the migration, I am adding the existing allowedRefundSources to the account code to index code table, but not sure if that is right.
Test Cases
Screenshots
Checklist
yarn.lockchanges (unless dependencies have changed)Closes #3271