Repository navigation
#4422 adding shared type - #4628
Conversation
| category: { budget: number } | null; | ||
| activationChangeRequest: { startDate: Date } | null; | ||
| }): TriageScoreInput => { | ||
| const currentBudget = changeRequest.accountCode?.amount ?? changeRequest.category?.budget ?? undefined; |
There was a problem hiding this comment.
When a budget change request targets a category, reviewBudgetChangeRequest treats the category as the specific target and updates category.budget. Here the account code's amount is used whenever it's set, so a category change request is scored against the wrong budget. Change to: const currentBudget = changeRequest.category?.budget ?? changeRequest.accountCode?.amount ?? undefined;
| activationChangeRequest: { startDate: Date } | null; | ||
| }): TriageScoreInput => { | ||
| const currentBudget = changeRequest.accountCode?.amount ?? changeRequest.category?.budget ?? undefined; | ||
| const proposedBudget = changeRequest.budgetChangeRequest?.proposedBudget; |
There was a problem hiding this comment.
standard change requests that change the project budget get no budget score
budgetChange is only built from budgetChangeRequest, so a standard change request with projectProposedChanges.budget set changes a project's budget but scores 0 on budget
Add wbsProposedChanges.projectProposedChanges
| activationChangeRequest: { startDate: Date } | null; | ||
| }): TriageScoreInput => { | ||
| const currentBudget = changeRequest.accountCode?.amount ?? changeRequest.category?.budget ?? undefined; | ||
| const proposedBudget = changeRequest.budgetChangeRequest?.proposedBudget; |
There was a problem hiding this comment.
budget has no snapshot, so accepted change requests score 0 on budget
We need a snapshotBudget column filled in when the change request is created (from the account code or category for budget change requests, and from project.budget for standard change requests)
Changes
Added triageScore to the shared Change Request type.
Updated the transformer to handle the new field.
Updated the associated tests to reflect these changes.
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 #4422