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-2682 - Staff Manage queue #1587

Merged
merged 4 commits into from
Sep 9, 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
16 changes: 16 additions & 0 deletions dops/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ export class AppService {
),
);

await addToCache(
this.cacheManager,
CacheKey.EMAIL_TEMPLATE_APPLICATION_APPROVED,
this.convertFileToString(
assetsPath + 'templates/application-approved.email.hbs',
),
);

await addToCache(
this.cacheManager,
CacheKey.EMAIL_TEMPLATE_APPLICATION_REJECTED,
this.convertFileToString(
assetsPath + 'templates/application-rejected.email.hbs',
),
);

const featureFlags = await this.featureFlagsService.findAll();
await addToCache(
this.cacheManager,
Expand Down
138 changes: 138 additions & 0 deletions dops/src/assets/templates/application-approved.email.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Application Approved</title>
</head>

<div>
<div class="container" style="margin: 0 2em">
<br />
<div>
<img src="{{ whiteHeaderLogo }}" alt="motiBCLogo" />
</div>

<br />

<hr class="solid" style="border-top: 1px solid #dbdcdc" />
<div class="flex-container" style="margin: 1em 0">
<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
Application {{ applicationNumber }} for plate {{ plate }} has been
approved and is now ready for purchase in the {{ companyName }} shopping
cart.
</p>
</div>

<div class="flex-container" style="margin: 1em 0">
<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
You can apply for additional permits online at
<a href="https://www.onroutebc.gov.bc.ca/" style="color: #1a5a96"
>https://onroutebc.gov.bc.ca/</a
>.
</p>
</div>

<div class="flex-container" style="margin: 1em 0">
<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
<b>
THIS EMAIL BOX IS NOT MONITORED AND ANY EMAILS SENT TO IT WILL NOT BE
ANSWERED. IF YOU HAVE ANY QUESTIONS, REQUESTS, PLEASE EMAIL:
</b>
<a href="mailto:[email protected]" style="color: #1a5a96"
>ppcpermit&#64;gov.bc.ca</a
>. If you have received this message in error, then please contact
<a href="mailto:[email protected]" style="color: #1a5a96"
>ppcpermit&#64;gov.bc.ca</a
>
and then immediately delete/discard this transmission, including all
attachments, without copying, distributing or disclosing same.
</p>
</div>

<hr class="solid" style="border-top: 1px solid #dbdcdc" />
<div class="flex-container" style="margin: 1em 0">
<br />
<div>
<img
src="{{ whiteFooterLogo }}"
alt="onRouteBCLogo"
style="margin: 0px"
/>
</div>

<br />

<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
Have questions or need help? Check out the
<a
href="https://www2.gov.bc.ca/gov/content/transportation/vehicle-safety-enforcement/services/permitting/commercial-transport-permits"
style="color: #1a5a96"
>Commercial Vehicle Permits</a
>
page or email us at
<a href="mailto:[email protected]" style="color: #1a5a96"
>onRouteBc&#64;gov.bc.ca</a
>.
</p>

<br />

<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
<a href="#" style="color: #1a5a96">Terms of Service</a>
and
<a href="#" style="color: #1a5a96">Privacy Policy</a>
</p>
</div>
<hr class="solid" style="border-top: 1px solid #dbdcdc" />
</div>
</div>
179 changes: 179 additions & 0 deletions dops/src/assets/templates/application-rejected.email.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Application Rejected</title>
</head>

<div>
<div class="container" style="margin: 0 2em">
<br />
<div>
<img src="{{ whiteHeaderLogo }}" alt="motiBCLogo" />
</div>

<br />

<hr class="solid" style="border-top: 1px solid #dbdcdc" />
<div class="flex-container" style="margin: 1em 0">
<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
Reason for rejection:
</p>
<div
class="reject-reason-section"
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
<p
class="reject-reason-section__item"
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0;
padding: 0;
"
>
{{ rejectedDateTime }}
</p>
<p
class="reject-reason-section__item"
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0;
padding: 0;
"
>
{{ rejectedReason }}
</p>
</div>
</div>

<div class="flex-container" style="margin: 1em 0">
<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
You can apply for additional permits online at
<a href="https://www.onroutebc.gov.bc.ca/" style="color: #1a5a96"
>https://onroutebc.gov.bc.ca/</a
>.
</p>
</div>

<div class="flex-container" style="margin: 1em 0">
<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
<b>
THIS EMAIL BOX IS NOT MONITORED AND ANY EMAILS SENT TO IT WILL NOT BE
ANSWERED. IF YOU HAVE ANY QUESTIONS, REQUESTS, PLEASE EMAIL:
</b>
<a href="mailto:[email protected]" style="color: #1a5a96"
>ppcpermit&#64;gov.bc.ca</a
>. If you have received this message in error, then please contact
<a href="mailto:[email protected]" style="color: #1a5a96"
>ppcpermit&#64;gov.bc.ca</a
>
and then immediately delete/discard this transmission, including all
attachments, without copying, distributing or disclosing same.
</p>
</div>

<hr class="solid" style="border-top: 1px solid #dbdcdc" />
<div class="flex-container" style="margin: 1em 0">
<br />
<div>
<img
src="{{ whiteFooterLogo }}"
alt="onRouteBCLogo"
style="margin: 0px"
/>
</div>

<br />

<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
Have questions or need help? Check out the
<a
href="https://www2.gov.bc.ca/gov/content/transportation/vehicle-safety-enforcement/services/permitting/commercial-transport-permits"
style="color: #1a5a96"
>Commercial Vehicle Permits</a
>
page or email us at
<a href="mailto:[email protected]" style="color: #1a5a96"
>onRouteBc&#64;gov.bc.ca</a
>.
</p>

<br />

<p
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0px;
"
>
<a href="#" style="color: #1a5a96">Terms of Service</a>
and
<a href="#" style="color: #1a5a96">Privacy Policy</a>
</p>
</div>
<hr class="solid" style="border-top: 1px solid #dbdcdc" />
</div>
</div>
2 changes: 2 additions & 0 deletions dops/src/enum/cache-key.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export enum CacheKey {
EMAIL_TEMPLATE_PAYMENT_RECEIPT = 'EMAIL_TEMPLATE_PAYMENT_RECEIPT',
EMAIL_TEMPLATE_COMPANY_SUSPEND = 'EMAIL_TEMPLATE_COMPANY_SUSPEND',
EMAIL_TEMPLATE_COMPANY_UNSUSPEND = 'EMAIL_TEMPLATE_COMPANY_UNSUSPEND',
EMAIL_TEMPLATE_APPLICATION_APPROVED = 'EMAIL_TEMPLATE_APPLICATION_APPROVED',
EMAIL_TEMPLATE_APPLICATION_REJECTED = 'EMAIL_TEMPLATE_APPLICATION_REJECTED',
EMAIL_TEMPLATE_ORBC_STYLE = 'EMAIL_TEMPLATE_ORBC_STYLE',
CHES_ACCESS_TOKEN = 'CHES_ACCESS_TOKEN',
CDOGS_ACCESS_TOKEN = 'CDOGS_ACCESS_TOKEN',
Expand Down
2 changes: 2 additions & 0 deletions dops/src/enum/notification-template.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ export enum NotificationTemplate {
PAYMENT_RECEIPT = 'PAYMENT_RECEIPT',
COMPANY_SUSPEND = 'COMPANY_SUSPEND',
COMPANY_UNSUSPEND = 'COMPANY_UNSUSPEND',
APPLICATION_APPROVED = 'APPLICATION_APPROVED',
APPLICATION_REJECTED = 'APPLICATION_REJECTED',
}
4 changes: 4 additions & 0 deletions dops/src/helper/notification.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const getCacheKeyforEmailTemplate = (
return CacheKey.EMAIL_TEMPLATE_COMPANY_SUSPEND;
case NotificationTemplate.COMPANY_UNSUSPEND:
return CacheKey.EMAIL_TEMPLATE_COMPANY_UNSUSPEND;
case NotificationTemplate.APPLICATION_APPROVED:
return CacheKey.EMAIL_TEMPLATE_APPLICATION_APPROVED;
case NotificationTemplate.APPLICATION_REJECTED:
return CacheKey.EMAIL_TEMPLATE_APPLICATION_REJECTED;
default:
throw new Error('Invalid template name');
}
Expand Down
2 changes: 2 additions & 0 deletions vehicles/src/common/enum/notification-template.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ export enum NotificationTemplate {
PAYMENT_RECEIPT = 'PAYMENT_RECEIPT',
COMPANY_SUSPEND = 'COMPANY_SUSPEND',
COMPANY_UNSUSPEND = 'COMPANY_UNSUSPEND',
APPLICATION_APPROVED = 'APPLICATION_APPROVED',
APPLICATION_REJECTED = 'APPLICATION_REJECTED',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ApplicationApprovedNotification {
applicationNumber: string;
plate: string;
companyName: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ApplicationRejectedNotification {
rejectedDateTime: string;
rejectedReason: string;
}
Loading
Loading