Skip to content

Commit

Permalink
fix: remove condition blocking scoresheet view for incomplete reportcard
Browse files Browse the repository at this point in the history
  • Loading branch information
bdolor committed Dec 12, 2023
1 parent 43a0420 commit 9ad7d0e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/shared/lib/resources/proposal/sprint-with-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,21 @@ export function swuProposalTotalProposedCost(proposal: SWUProposal): number {
]);
}

/**
* Returns true if the proposal has a rank, and is either awarded or not awarded.
* Used to determine if the scoreSheet should be presented to the user.
*
* @remarks
* Covers an edge case where proposal.totalScore can be undefined while
* proposal.rank is defined, when a vendor is screened in but all scores
* (TQ, CC, TS, P) have not been entered.
*
* @see const includeTotalScore in {@link calculateScores} 'src/back-end/lib/db/proposal/sprint-with-us.ts'
*
* @param proposal SWUProposal
*/
export function showScoreAndRankToProponent(proposal: SWUProposal): boolean {
return (
proposal.totalScore !== undefined &&
proposal.rank !== undefined &&
(proposal.status === SWUProposalStatus.Awarded ||
proposal.status === SWUProposalStatus.NotAwarded)
Expand Down
14 changes: 13 additions & 1 deletion src/shared/lib/resources/proposal/team-with-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,21 @@ export function calculateProposalResourceQuestionScore(
return (actualScore / maxPossibleScore) * 100;
}

/**
* Returns true if the proposal has a rank, and is either awarded or not awarded.
* Used to determine if the scoreSheet should be presented to the user.
*
* @remarks
* Covers an edge case where proposal.totalScore can be undefined while
* proposal.rank is defined, when a vendor is screened in but all scores
* (TQ, CC, TS, P) have not been entered.
*
* @see const includeTotalScore in {@link calculateScores} 'src/back-end/lib/db/proposal/team-with-us.ts'
*
* @param proposal SWUProposal
*/
export function showScoreAndRankToProponent(proposal: TWUProposal): boolean {
return (
proposal.totalScore !== undefined &&
proposal.rank !== undefined &&
(proposal.status === TWUProposalStatus.Awarded ||
proposal.status === TWUProposalStatus.NotAwarded)
Expand Down

0 comments on commit 9ad7d0e

Please sign in to comment.