#4243 finance content - #4326
Conversation
Steph375
left a comment
There was a problem hiding this comment.
Looks good, thanks for the help! I just had one clarifying question
Santiordon
left a comment
There was a problem hiding this comment.
Looking good! Just left some small adjustments but this is really good code! Thanks for lightening the load a bit!
wavehassman
left a comment
There was a problem hiding this comment.
Phase 1 already computes everything else synchronously before any writes happen. Extending PlannedRequest to also carry these four pre-decided values would make Phase 2 pure writes with zero faker calls which would keep the concurrency speedup from the "Synchronization and Batching" commit while restoring deterministic, reproducible seed output
|
|
||
| // Products (and their reasons + tied-material status updates) are independent of each other. | ||
| const productWrites = group.map((spec, productIndex) => { | ||
| const otherReasonId = |
There was a problem hiding this comment.
Concurrent async resolution order isn't guaranteed, so this breaks reproducibility
|
|
||
| const reason = await this.prisma.reimbursement_Product_Reason.create({ data: reasonCreateInput }); | ||
|
|
||
| const productName = |
There was a problem hiding this comment.
faker call inside the concurrently-executed per-product write. Move to Phase 1 with above
| admins: FullUser[], | ||
| financePersonnel: FullUser[] | ||
| ): Promise<void> { | ||
| const actor = this.pickActorForStage(step.type, recipient, headApprovers, admins, financePersonnel); |
There was a problem hiding this comment.
the actor for each status-history step is chosen inside the concurrent per-request batch instead of during planning
Move to Phase 1: compute actorId per step and carry it alongside the step's date
| ); | ||
| } | ||
|
|
||
| if ( |
There was a problem hiding this comment.
(dateDelivered / assignee / extra-comment decisions in createReimbursementRequest's followUps block): all three still call faker inside the concurrently-executed function. Move all three into Phase 1 and just consume the pre-decided values here
Changes
Made
Reimbursement_Request,Reimbursement_Status,Receipt,Reimbursement_Product_Reason,Reimbursement_Product,Refund_Source,Reimbursement,Reimbursement_Request_Comment.Generates 150 reimbursement requests per car
Reimbursementrecord is generated per recipient off their accumulated reimbursed total.NEED MATERIALS TO BE MERGED IN BEFORE THIS
Checklist
It can be helpful to check the
ChecksandFiles changedtabs.Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
yarn.lockchanges (unless dependencies have changed)Closes #4243