Skip to content
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

#3697 - View Assessment Updates #3813

Merged
merged 9 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
v-if="isSecondDisbursementAvailable"
class="category-header-medium secondary-color my-3"
>
First Payment
First disbursement
</h3>
<v-row>
<v-col>
Expand Down Expand Up @@ -141,7 +141,9 @@
</div>
<!-- Estimated and actual award details of second disbursement. -->
<div v-if="isSecondDisbursementAvailable">
<h3 class="category-header-medium secondary-color my-3">Second Payment</h3>
<h3 class="category-header-medium secondary-color my-3">
Second disbursement
</h3>
<v-row>
<v-col>
<content-group>
Expand Down
14 changes: 10 additions & 4 deletions sources/packages/web/src/components/common/AwardTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<tbody>
<tr v-for="award in awards" :key="award.awardType">
<td>
{{ award.awardType }}
{{ award.awardTypeDisplay }}
<tooltip-icon>{{ award.description }}</tooltip-icon>
</td>
<td>
Expand All @@ -24,6 +24,7 @@ import { PropType, defineComponent, computed } from "vue";
import { OfferingIntensity } from "@/types";
import { AWARDS, AwardDetail } from "@/constants/award-constants";
import { DynamicAwardValue } from "@/services/http/dto";
import { useFormatters } from "@/composables";

export default defineComponent({
props: {
Expand All @@ -47,17 +48,22 @@ export default defineComponent({
(award) => award.offeringIntensity === props.offeringIntensity,
),
);
const { getFormattedMoneyValue } = useFormatters();

const getAwardValue = (awardType: string): string | number | Date => {
const awardValue =
props.awardDetails[`${props.identifier}${awardType.toLowerCase()}`];
const awardValue = props.awardDetails[
`${props.identifier}${awardType.toLowerCase()}`
] as number;
// If the award is defined but no values are present it means that a receipt value is missing.
if (awardValue === null) {
return "-";
}
// If the award in not defined at all it means that the award is not eligible and it was not
// part of the disbursement calculations output.
return awardValue ?? "(Not eligible)";
if (awardValue === undefined) {
return "(Not eligible)";
}
return getFormattedMoneyValue(awardValue);
Copy link
Collaborator

@andrepestana-aot andrepestana-aot Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return awardValue === undefined ? getFormattedMoneyValue(awardValue) : "(Not eligible)";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the opposite @andrepestana-aot when undefined "(Not eligible)" needs to return. Are you saying this as a suggestion?

};

return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<body-header
title="Summary"
subTitle="Below is the summary from your assessment. To view your entire assessment, click on View assessment."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this period in the end to be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to keep the period. The AC is to replace the sentence, and it makes sense to keep the period at the end for a sentence.

Copy link
Collaborator

@dheepak-aot dheepak-aot Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image in AC says that period is retained.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there was a period at the end, but there wasn't. It's updated.

title="Funding summary"
subTitle="Below is the summary from your assessment. To view your Notice of Assessment, click on view assessment."
>
<template #actions>
<v-btn
Expand Down
12 changes: 12 additions & 0 deletions sources/packages/web/src/composables/useFormatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,17 @@ export function useFormatters() {
return "No disability funding types included on assessment.";
};

/**
* Format the money value to the form ##,###.00
* @param moneyValue money value to be formatted.
* @returns the formatted money value.
*/
const getFormattedMoneyValue = (moneyValue: number): string => {
return `$${moneyValue.toLocaleString("en-CA", {
minimumFractionDigits: 2,
})}`;
};

return {
dateOnlyLongString,
dateOnlyLongPeriodString,
Expand All @@ -418,5 +429,6 @@ export function useFormatters() {
isBeforeDateOnly,
disabilityStatusToDisplay,
applicationDisabilityStatusToDisplay,
getFormattedMoneyValue,
};
}
60 changes: 38 additions & 22 deletions sources/packages/web/src/constants/award-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { OfferingIntensity } from "@/types";

export interface AwardDetail {
awardType: FullTimeAwardTypes | PartTimeAwardTypes;
awardTypeDisplay: string;
description: string;
offeringIntensity: OfferingIntensity;
}
Expand Down Expand Up @@ -30,77 +31,92 @@ export enum PartTimeAwardTypes {
export const AWARDS: AwardDetail[] = [
{
awardType: FullTimeAwardTypes.CSLF,
awardTypeDisplay: FullTimeAwardTypes.CSLF,
description: "Canada Student Loan for Full-time Studies",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.CSGP,
awardTypeDisplay: FullTimeAwardTypes.CSGP,
description: "Canada Student Grant for Student with Permanent Disability",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.CSGD,
awardTypeDisplay: FullTimeAwardTypes.CSGD,
description: "Canada Student Grant for Students with Dependents",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.CSGF,
awardTypeDisplay: FullTimeAwardTypes.CSGF,
description: "Canada Student Grant for Full-time Studies",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.CSGT,
awardTypeDisplay: FullTimeAwardTypes.CSGT,
description: "Canada Student Grant for Full-time Top-up",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: PartTimeAwardTypes.CSLP,
description: "Canada Student Loan for Part-time Studies",
dheepak-aot marked this conversation as resolved.
Show resolved Hide resolved
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.CSGP,
description: "Canada Student Grant for Student with Permanent Disability",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.CSPT,
description: "Canada Student Grant for Part-time Studies",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.CSGD,
description: "Canada Student Grant for Students with Dependents",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: FullTimeAwardTypes.BCSL,
awardTypeDisplay: FullTimeAwardTypes.BCSL,
description: "B.C. Student Loan",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.BCAG,
awardTypeDisplay: FullTimeAwardTypes.BCAG,
description: "B.C. Access Grant",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.BGPD,
awardTypeDisplay: FullTimeAwardTypes.BGPD,
description: "B.C. Permanent Disability Grant",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: FullTimeAwardTypes.SBSD,
awardTypeDisplay: FullTimeAwardTypes.SBSD,
description: "B.C. Supplemental Bursary with Disabilities",
offeringIntensity: OfferingIntensity.fullTime,
},
{
awardType: PartTimeAwardTypes.CSGP,
awardTypeDisplay: "CSG-PD",
description: "Canada Student Grant for Students with Disabilities",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.CSPT,
awardTypeDisplay: "CSG-PT",
description: "Canada Student Grant for Part-time Students",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.CSGD,
awardTypeDisplay: "CSG-PTDEP",
description: "Canada Student Grant for Students with Dependants",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.BCAG,
description: "B.C. Access Grant",
awardTypeDisplay: "BCAG-PT",
description: "B.C. Access Grant for Part-time Studies",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.CSLP,
awardTypeDisplay: "CSL-PT",
description: "Canada Student Loan for Part-time Students",
offeringIntensity: OfferingIntensity.partTime,
},
{
awardType: PartTimeAwardTypes.SBSD,
description: "B.C. Supplemental Bursary with Disabilities",
awardTypeDisplay: PartTimeAwardTypes.SBSD,
description: "B.C. Supplemental Bursary for Students with Disabilities",
offeringIntensity: OfferingIntensity.partTime,
},
];