Skip to content

Commit

Permalink
22290 Updated continuation "PAID" email (bcgov#2934)
Browse files Browse the repository at this point in the history
* - added template parts to list and updated comments
- added foreign jurisdiction computation and included it in continuation in variables
- updated CONT-IN-PAID template to match UI designs
- added some "true" whitespace template partsf and updated comments
- added template part for continuation application details
- added class to style and update title message whitespace
- updated a comment for future

* - added "- Pending" to continuation application attachment name

* - changed "EXPRO" check to "business" check

* - deleted debugging code

---------

Co-authored-by: Severin Beauvais <[email protected]>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Aug 20, 2024
1 parent f488c30 commit acec461
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,17 @@ def substitute_template_parts(template_code: str) -> str:
Template parts are marked by [[partname.html]] in templates.
This functionality is restricted by:
- markup must be exactly [[partname.html]] and have no extra spaces around file name
- template parts can only be one level deep, ie: this rudimentary framework does not handle nested template
parts. There is no recursive search and replace.
- Markup must be exactly [[partname.html]] and have no extra spaces around the file name.
- Some nesting is supported: earlier templates can include later templates. Hence, the order of
template parts, below, is important.
- Do not comment out template parts as they may be replaced anyway!
"""
template_parts = [
'business-dashboard-link',
'business-dashboard-link-alt',
'business-info',
'business-information',
'continuation-application-details',
'reg-business-info',
'cra-notice',
'nr-footer',
Expand All @@ -183,11 +185,14 @@ def substitute_template_parts(template_code: str) -> str:
'initiative-notice',
'logo',
'pdf-notice',
'style',
'divider',
'8px',
'16px',
'20px',
'24px',
'whitespace-16px',
'whitespace-24px'
'whitespace-24px',
'style'
]

# substitute template parts - marked up by [[filename]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from http import HTTPStatus
from pathlib import Path

import pycountry
import requests
from entity_queue_common.service_utils import logger
from flask import current_app
Expand Down Expand Up @@ -57,7 +58,7 @@ def _get_pdfs(
if filing_pdf_encoded:
pdfs.append(
{
'fileName': 'Continuation Application.pdf',
'fileName': 'Continuation Application - Pending.pdf',
'fileBytes': filing_pdf_encoded.decode('utf-8'),
'fileUrl': '',
'attachOrder': str(attach_order)
Expand Down Expand Up @@ -140,6 +141,15 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l
numbered_description = Business.BUSINESSES.get(legal_type, {}).get('numberedDescription')
jnja_template = Template(filled_template, autoescape=True)

# compute Foreign Jurisdiction string as in report.py and business_document.py
country_code = filing_data['foreignJurisdiction']['country']
region_code = filing_data['foreignJurisdiction']['region']
country = pycountry.countries.get(alpha_2=country_code)
region = None
if region_code and region_code.upper() != 'FEDERAL':
region = pycountry.subdivisions.get(code=f'{country_code}-{region_code}')
foreign_jurisdiction = f'{region.name}, {country.name}' if region else country.name

html_out = jnja_template.render(
business=business,
filing=filing_data,
Expand All @@ -150,7 +160,8 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l
entity_dashboard_url=get_entity_dashboard_url(business.get('identifier'), token),
email_header=filing_name.upper(),
filing_type=filing_type,
numbered_description=numbered_description
numbered_description=numbered_description,
foreign_jurisdiction=foreign_jurisdiction
)

# get attachments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,46 @@
[[header.html]]

<div class="container">
<p class="title-message bold">We have received your continuation application.</p>
<!-- first section -->
<p class="title-message bold">We have received your Continuation Application</p>

[[business-information.html]]
<p>BC Registries will review your Continuation Authorization documents and contact you
with the results within 2 business days.</p>

[[20px.html]]
[[divider.html]]
[[20px.html]]

<!-- second section -->
[[continuation-application-details.html]]

[[20px.html]]
[[divider.html]]
[[20px.html]]

<!-- third section -->
<p class="title-message bold">Attached to this Email</p>

<p>The following documents are attached to this email:</p>
<ul class="outputs">
<li>Continuation Application</li>
<li>Continuation Application - Pending</li>
<li>Receipt</li>
</ul>

[[whitespace-16px.html]]
[[business-dashboard-link.html]]
[[whitespace-16px.html]]
[[8px.html]]

<p>
Once your filing has been processed, the business will be registered, and the company will receive the
below outputs:
Once your authorization has been approved, your business will be registered and you will
receive the following outputs:
</p>
<ul class="outputs">
<li>Notice of Articles</li>
<li>Certificate of Continuation</li>
</ul>

[[whitespace-16px.html]]
[[pdf-notice.html]]

[[whitespace-16px.html]]
[[20px.html]]
<!-- fourth section -->
[[24px.html]]
[[footer.html]]
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- empty paragraph for spacing -->
<!-- height = 0 + 16 = 16px -->
<p style="margin-top: 16px !important;"></p>
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<!-- empty paragraph for spacing -->
<!-- height = 0 + 20 = 20px -->
<p style="margin-top: 20px !important;"></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- empty paragraph for spacing -->
<!-- height = 0 + 24 = 24px -->
<p style="margin-top: 24px !important;"></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- empty paragraph for spacing -->
<!-- height = 0 + 8 = 8px -->
<p style="margin-top: 8px !important;"></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="continuation-application-details">
<p class="title-message bold">Your Continuation Application Details</p>
<div>
<div class="name bold">Identifying Number in Foreign Jurisdiction:</div>
<div class="value">{{ filing.foreignJurisdiction.identifier }}</div>
</div>
[[16px.html]]
<div>
<div class="name bold">Name in Foreign Jurisdiction:</div>
<div class="value">{{ filing.foreignJurisdiction.legalName }}</div>
</div>
[[16px.html]]
<div>
<div class="name bold">Foreign Jurisdiction:</div>
<div class="value">{{ foreign_jurisdiction }}</div>
</div>

{% if filing.business %}
[[16px.html]]
<div>
<div class="name bold">Extraprovincial Registration Number in B.C.:</div>
<div class="value">{{ filing.business.identifier }}</div>
</div>
{% endif %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

.title-message {
font-size: 24px;
line-height: 34px;
padding-bottom: 16px;
}

.container {
Expand All @@ -85,7 +85,8 @@
text-transform: uppercase;
}

.business-information .value {
.business-information .value,
.continuation-application-details .value {
line-height: 24px;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!-- empty paragraph for spacing -->
<!-- paragraph for spacing -->
<!-- height = 16 + 16 = 32px -->
<p style="margin-top: 16px !important;">&nbsp;</p>
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!-- empty paragraph for spacing -->
<!-- paragraph for spacing -->
<!-- height = 16 + 24 = 40px -->
<p style="margin-top: 24px !important;">&nbsp;</p>
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def get_message_context_properties(queue_msg: nats.aio.client.Msg):
'restoration', 'specialResolution', 'correction', 'amalgamationApplication', 'continuationIn') \
and (option := email.get('option', None)) \
and (filing_id := email.get('filingId', None)):
# option contains current status of filing - PAID or COMPLETED
# option contains current status of filing - PAID or COMPLETED or CHANGE_REQUESTED, etc
message_id = f'{etype}_{option}_{filing_id}'
return create_message_context_properties(etype, message_id, None, None, False)

Expand Down

0 comments on commit acec461

Please sign in to comment.