From 9dd96437473c2584ead7a0961f69927e1f2f3f96 Mon Sep 17 00:00:00 2001 From: leodube-aot <122323255+leodube-aot@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:44:08 -0500 Subject: [PATCH] 21768 Emailer - stage 1 overdue transition notification (#2867) * Add no transition email template * Update invol dissolution email template * Clean up code changes * Add unit test --- ...oluntary_dissolution_stage_1_notification.py | 4 +++- .../email_templates/INVOL-DIS-STAGE-1.html | 17 +++++++++++++++++ .../entity-emailer/tests/unit/test_tracker.py | 17 +++++++++++++++++ .../entity-emailer/tests/unit/test_worker.py | 2 +- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/involuntary_dissolution_stage_1_notification.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/involuntary_dissolution_stage_1_notification.py index 679ecd8355..056f3cbc11 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/involuntary_dissolution_stage_1_notification.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/involuntary_dissolution_stage_1_notification.py @@ -44,6 +44,7 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l furnishing = Furnishing.find_by_id(furnishing_id) business = furnishing.business business_identifier = business.identifier + # get template template = Path( f'{current_app.config.get("TEMPLATE_PATH")}/INVOL-DIS-STAGE-1.html' ).read_text() @@ -57,7 +58,8 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l html_out = jnja_template.render( business=business.json(), entity_dashboard_url=get_entity_dashboard_url(business_identifier, token), - extra_provincials=extra_provincials + extra_provincials=extra_provincials, + furnishing_name=furnishing.furnishing_name ) # get recipients recipients = [] diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/INVOL-DIS-STAGE-1.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/INVOL-DIS-STAGE-1.html index 066047d732..d9bc2b0bd0 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/INVOL-DIS-STAGE-1.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/INVOL-DIS-STAGE-1.html @@ -23,19 +23,36 @@ [[20px.html]] + {% if 'NO_AR' in furnishing_name %}
Your business is in the process of being dissolved because it hasn't filed its required annual reports. Please file your overdue annual reports as soon as possible by logging into your Business Page.
+ {% else %} +Your business is in the process of being dissolved because it hasn't + filed its required Post Restoration Transition Application (PRTA). + Please file your overdue PRTA as soon as possible by logging into + your Business Page. +
+ {% endif %} [[whitespace-16px.html]] + {% if 'NO_AR' in furnishing_name %}Under the Business Corporations Act, if you don't file these reports within one month from today, the Registrar will post a public notice on www.bclaws.ca. This notice will state that your company may be dissolved if the annual reports aren't filed after one month.
+ {% else %} ++ Under the Business Corporations Act, if you don't file your PRTA + within one month from today, the Registrar will post a public notice + on www.bclaws.ca. This notice will state that your company may be + dissolved if the PRTA aren't filed after one month. +
+ {% endif %} [[whitespace-16px.html]] diff --git a/queue_services/entity-emailer/tests/unit/test_tracker.py b/queue_services/entity-emailer/tests/unit/test_tracker.py index 8e6fc5147f..88f837d96b 100644 --- a/queue_services/entity-emailer/tests/unit/test_tracker.py +++ b/queue_services/entity-emailer/tests/unit/test_tracker.py @@ -140,6 +140,23 @@ } } }), + ('f36e3af7-90c3-4859-a6f6-2feefbdc1e30', + { + 'specversion': '1.x-wip', + 'type': 'bc.registry.dissolution', + 'source': 'furnishingsJob', + 'id': 'f36e3af7-90c3-4859-a6f6-2feefbdc1e30', + 'time': '', + 'datacontenttype': 'application/json', + 'identifier': 'BC123223', + 'data': { + 'furnishing': { + 'type': 'INVOLUNTARY_DISSOLUTION', + 'furnishingId': 1, + 'furnishingName': 'DISSOLUTION_COMMENCEMENT_NO_TR' + } + } + }), ('bc.registry.affiliation_1', { 'type': 'bc.registry.affiliation', diff --git a/queue_services/entity-emailer/tests/unit/test_worker.py b/queue_services/entity-emailer/tests/unit/test_worker.py index dabc62eb8f..9cb8e73610 100644 --- a/queue_services/entity-emailer/tests/unit/test_worker.py +++ b/queue_services/entity-emailer/tests/unit/test_worker.py @@ -480,7 +480,7 @@ def test_send_email_with_incomplete_payload(app, session, email_msg): ]) def test_involuntary_dissolution_stage_1_notification(app, db, session, mocker, test_name, exception, furnishing_name, expected_furnishing_status): - """Assert that the stage 1 overdue ARs notification can be processed.""" + """Assert that the stage 1 notifications can be processed.""" business_identifier = 'BC1234567' business = create_business(business_identifier, 'BC', 'Test Business') furnishing = create_furnishing(session, business=business)