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

ORV2-2309 - Loa permit template changes #1425

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions vehicles/src/common/helper/format-template-data.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const formatTemplateData = (
issuedBy: '',
revisions: [],
permitData: null,
loas: '',
};

template.permitData = JSON.parse(permit.permitData.permitData) as PermitData;
Expand Down Expand Up @@ -108,5 +109,10 @@ export const formatTemplateData = (
}
});

template.loas = template?.permitData?.loas
?.filter((item) => item.checked)
?.map((item) => item?.loaId)
.join(', ');

return template;
};
8 changes: 8 additions & 0 deletions vehicles/src/common/interface/permit.template.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface PermitTemplateData {
issuedBy: string;
revisions: Revision[];
permitData?: PermitData;
loas?: string;
}

interface Revision {
Expand All @@ -26,6 +27,7 @@ export interface PermitData {
contactDetails?: ContactDetails;
vehicleDetails?: VehicleDetails;
commodities: Commodities[];
loas: Loas[]; //Letter of Authorizations
mailingAddress: MailingAddress;
companyName: string;
clientNumber: string;
Expand Down Expand Up @@ -71,3 +73,9 @@ interface Commodities {
checked: boolean;
disabled?: boolean;
}

interface Loas {
loaId: string;
checked: boolean;
disabled?: boolean;
}