From dd48526b0b3e3577764a9bc040127d40b5c0b476 Mon Sep 17 00:00:00 2001 From: Vysakh Menon Date: Mon, 15 Jun 2026 16:02:17 -0700 Subject: [PATCH 1/3] 33515 updating the old COOPS outputs to the modern templates --- legal-api/report-templates/annualReport.html | 98 ++++--- .../report-templates/changeOfAddress.html | 79 ++---- .../report-templates/changeOfDirectors.html | 80 ++---- .../template-parts/addresses.html | 61 +++-- .../common/businessDetails.html | 16 +- .../template-parts/common/style.html | 1 + .../template-parts/directors.html | 252 ++++++++++++------ .../business_filings/business_documents.py | 2 +- 8 files changed, 312 insertions(+), 277 deletions(-) diff --git a/legal-api/report-templates/annualReport.html b/legal-api/report-templates/annualReport.html index 812d944153..e9ee0780aa 100644 --- a/legal-api/report-templates/annualReport.html +++ b/legal-api/report-templates/annualReport.html @@ -1,67 +1,59 @@ [[macros.html]] - - {{ meta_title }} + Annual Report - - -[[style.html]] - + [[common/style.html]] + {% if enable_sandbox %} + [[common/watermark.html]] + {% endif %} - - - [[logo.html]] - -
-
-
- {{ header.ARFilingYear }} BC COOPERATIVE ANNUAL REPORT -
-
- BC Cooperative • Cooperative Association Act -
- -
-
- {{ business.legalName }} -
- - -
- - - - - - - - - - - - - - - - - -
Incorporation Number:{{ business.identifier }}
Business Number:{{ business.tax_id }}
Filing Date and Time:{{ filing_date_time }}
Annual General Meeting (AGM) Date:{{ agm_date }}
-
- {% if effective_date is defined %} -[[addresses.html]] - -[[directors.html]] -{% endif %} -[[certification.html]] - +
+ + + + + + +
+
+ [[common/businessDetails.html]] +
+ + + + + + +
+
+
+ {% if effective_date is defined %} + [[addresses.html]] +
-[[footer.html]] + [[directors.html]] + {% endif %} + [[certification.html]] +
diff --git a/legal-api/report-templates/changeOfAddress.html b/legal-api/report-templates/changeOfAddress.html index f59cc97590..ccc7ab5147 100644 --- a/legal-api/report-templates/changeOfAddress.html +++ b/legal-api/report-templates/changeOfAddress.html @@ -1,65 +1,38 @@ [[macros.html]] - - {{ meta_title }} + Address Change - - -[[style.html]] - + [[common/style.html]] + {% if enable_sandbox %} + [[common/watermark.html]] + {% endif %} - - - [[logo.html]] - -
-
-
- BC COOPERATIVE ADDRESS CHANGE -
-
- BC Cooperative • Cooperative Association Act -
- -
-
- {{ business.legalName }} -
- - -
- - - - - - - - - - - - - - - - - -
Incorporation Number:{{ business.identifier }}
Business Number:{{ business.tax_id }}
Filing Date and Time:{{ filing_date_time }}
Date of Change:{{ effective_date }}
-
- -[[addresses.html]] - -[[certification.html]] - +
+ + + + + + +
+
- -[[footer.html]] - + [[common/businessDetails.html]] +
+ [[addresses.html]] + [[certification.html]] +
diff --git a/legal-api/report-templates/changeOfDirectors.html b/legal-api/report-templates/changeOfDirectors.html index f21276a126..7d650eee87 100644 --- a/legal-api/report-templates/changeOfDirectors.html +++ b/legal-api/report-templates/changeOfDirectors.html @@ -1,66 +1,38 @@ [[macros.html]] - - {{ meta_title }} + Director Change - - -[[style.html]] - + [[common/style.html]] + {% if enable_sandbox %} + [[common/watermark.html]] + {% endif %} - - - [[logo.html]] - -
-
-
- BC COOPERATIVE DIRECTOR CHANGE -
-
- BC Cooperative • Cooperative Association Act -
- -
-
- {{ business.legalName }} -
- - -
- - - - - - - - - - - - - - - - - -
Incorporation Number:{{ business.identifier }}
Business Number:{{ business.tax_id }}
Filing Date and Time:{{ filing_date_time }}
Effective Date of Change:{{ effective_date }}
-
- -[[directors.html]] - -[[certification.html]] - - +
+ + + + + + +
+
- -[[footer.html]] - + [[common/businessDetails.html]] +
+ [[directors.html]] + [[certification.html]] +
diff --git a/legal-api/report-templates/template-parts/addresses.html b/legal-api/report-templates/template-parts/addresses.html index cb0ecdcf3b..d5e95f60b2 100644 --- a/legal-api/report-templates/template-parts/addresses.html +++ b/legal-api/report-templates/template-parts/addresses.html @@ -1,30 +1,35 @@ {% if registeredOfficeAddress is defined %} -
REGISTERED OFFICE ADDRESS
- -
- - - - - -
-
Delivery Address {% if 'addressChanged' in registeredOfficeAddress.deliveryAddress.actions %}{{ labelNew() }}{% endif %}
-
{{ registeredOfficeAddress.deliveryAddress.streetAddress }}
-
{{ registeredOfficeAddress.deliveryAddress.streetAddressAdditional }}
-
{{ registeredOfficeAddress.deliveryAddress.addressCity }} - {{ registeredOfficeAddress.deliveryAddress.addressRegion }} -  {{ registeredOfficeAddress.deliveryAddress.postalCode }}
-
{{ registeredOfficeAddress.deliveryAddress.addressCountry }}
-
{{ registeredOfficeAddress.deliveryAddress.deliveryInstructions }}
-
-
Mailing Address {% if 'addressChanged' in registeredOfficeAddress.mailingAddress.actions %}{{ labelNew() }}{% endif %}
-
{{ registeredOfficeAddress.mailingAddress.streetAddress }}
-
{{ registeredOfficeAddress.mailingAddress.streetAddressAdditional }}
-
{{ registeredOfficeAddress.mailingAddress.addressCity }} - {{ registeredOfficeAddress.mailingAddress.addressRegion }} -  {{ registeredOfficeAddress.mailingAddress.postalCode }}
-
{{ registeredOfficeAddress.mailingAddress.addressCountry }}
-
{{ registeredOfficeAddress.mailingAddress.deliveryInstructions }}
-
-
+
Registered Office Information
+ + + + + + {% endif %} diff --git a/legal-api/report-templates/template-parts/common/businessDetails.html b/legal-api/report-templates/template-parts/common/businessDetails.html index f981e20481..29401a7f7a 100644 --- a/legal-api/report-templates/template-parts/common/businessDetails.html +++ b/legal-api/report-templates/template-parts/common/businessDetails.html @@ -205,14 +205,22 @@
Incorporation Number:
Filed Date and Time:
{% if header.status == 'COMPLETED' %} -
Address Effective Date and Time:
+ {% if business.legalType == 'CP' %} +
Address Change Date:
+ {% else %} +
Address Effective Date and Time:
+ {% endif %} {% endif %}
{{business.identifier}}
{{filing_date_time}}
{% if header.status == 'COMPLETED' %} -
{{effective_date_time}}
+ {% if business.legalType == 'CP' %} +
{{effective_date}}
+ {% else %} +
{{effective_date_time}}
+ {% endif %} {% endif %} {% elif header.name == 'changeOfDirectors' %} @@ -238,7 +246,9 @@ {% endif %}
Filed Date and Time:
Recognition Date and Time:
+ {% if business.legalType != 'CP' %}
Annual Report Date:
+ {% endif %}
{{business.identifier}}
@@ -247,7 +257,9 @@ {% endif %}
{{filing_date_time}}
{{recognition_date_time}}
+ {% if business.legalType != 'CP' %}
{{effective_date}}
+ {% endif %} {% elif header.name == 'transition' %} diff --git a/legal-api/report-templates/template-parts/common/style.html b/legal-api/report-templates/template-parts/common/style.html index c3e4a9b30b..bae34bb51a 100644 --- a/legal-api/report-templates/template-parts/common/style.html +++ b/legal-api/report-templates/template-parts/common/style.html @@ -199,6 +199,7 @@ td.col-22 { width: 22% !important; } td.col-33 { width: 33% !important; } + td.col-35 { width: 35% !important; } td.col-67 { width: 67% !important; } td.col-50 { width: 50% !important; } diff --git a/legal-api/report-templates/template-parts/directors.html b/legal-api/report-templates/template-parts/directors.html index 64bc2e01fe..06cde9edc5 100644 --- a/legal-api/report-templates/template-parts/directors.html +++ b/legal-api/report-templates/template-parts/directors.html @@ -1,102 +1,182 @@ {% if listOfDirectors is defined %} - -{# only show Appointed and Ceased directors if filing did not come from Colin #} -{% if not source == 'COLIN' %} - - {# APPOINTED #} - -
- NEW DIRECTORS APPOINTED OR ELECTED +
New Directors Appointed or Elected
+ + {% for director in listOfDirectors.directorsAppointed %} + + + + + + {% else %} + + + + {% endfor %} + -
- CEASED DIRECTORS +
+
+
Ceased Directors
+
+ + {% for director in listOfDirectors.directorsCeased %} + + + + + + {% else %} + + + + {% endfor %} + -
- ALL DIRECTORS AS OF {{ effective_date.upper() }} -
-{% for director in listOfDirectors.directors %} -{% if not director.cessationDate %} -
-
- {{ director.officer.lastName }}, - {{ director.officer.firstName }} - {% if director.officer.middleInitial is defined %}{{ director.officer.middleInitial }}{% endif %} - {% if 'appointed' in director.actions %}{{ labelNew() }}{% endif %} - {% if 'nameChanged' in director.actions %} - - (Formerly {{ director.officer.prevLastName }}, - {{ director.officer.prevFirstName }} {{ director.officer.prevMiddleInitial }} - ) - +
+
+
All Directors as of {{ effective_date }}
+
+ + {% for director in listOfDirectors.directors %} + {% if not director.cessationDate %} + + + + + + {% endif %} + {% else %} + + + + {% endfor %} + {% endif %} diff --git a/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py b/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py index 6feb9615d9..3b2f0805da 100644 --- a/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py +++ b/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py @@ -105,7 +105,7 @@ def get_documents(identifier: str, # noqa: PLR0911, PLR0912 ), HTTPStatus.NOT_FOUND if _should_regenerate(legal_filing_name): - if jwt.validate_roles([UserRoles.staff, UserRoles.system]): + if jwt.contains_role([UserRoles.staff, UserRoles.system]): return get_pdf(filing.storage, legal_filing_name, True) else: return jsonify( From 5e143020ae133e02d1c849cc29e4eed37738ad89 Mon Sep 17 00:00:00 2001 From: Vysakh Menon Date: Tue, 16 Jun 2026 12:34:09 -0700 Subject: [PATCH 2/3] common template for coop and corps --- legal-api/report-templates/annualReport.html | 8 +- .../report-templates/bcAddressChange.html | 38 ---- .../report-templates/bcAnnualReport.html | 38 ---- .../report-templates/bcDirectorChange.html | 38 ---- .../report-templates/changeOfAddress.html | 6 +- .../report-templates/changeOfDirectors.html | 6 +- .../template-parts/addresses.html | 39 ++++ .../bc-address-change/addresses.html | 74 -------- .../bc-director-change/directors.html | 169 ------------------ legal-api/src/legal_api/reports/report.py | 33 ++-- 10 files changed, 64 insertions(+), 385 deletions(-) delete mode 100644 legal-api/report-templates/bcAddressChange.html delete mode 100644 legal-api/report-templates/bcAnnualReport.html delete mode 100644 legal-api/report-templates/bcDirectorChange.html delete mode 100644 legal-api/report-templates/template-parts/bc-address-change/addresses.html delete mode 100644 legal-api/report-templates/template-parts/bc-director-change/directors.html diff --git a/legal-api/report-templates/annualReport.html b/legal-api/report-templates/annualReport.html index e9ee0780aa..de4e167833 100644 --- a/legal-api/report-templates/annualReport.html +++ b/legal-api/report-templates/annualReport.html @@ -30,6 +30,7 @@
[[common/businessDetails.html]] + {% if business.legalType == 'CP' %}
@@ -53,7 +54,12 @@ [[directors.html]] {% endif %} [[certification.html]] - + {% else %} +
+
+ [[bc-annual-report/legalObligations.html]] +
+ {% endif %} diff --git a/legal-api/report-templates/bcAddressChange.html b/legal-api/report-templates/bcAddressChange.html deleted file mode 100644 index 17a5c2d329..0000000000 --- a/legal-api/report-templates/bcAddressChange.html +++ /dev/null @@ -1,38 +0,0 @@ -[[macros.html]] - - - - Address Change - - - [[common/style.html]] - {% if enable_sandbox %} - [[common/watermark.html]] - {% endif %} - - -
-
- - - - - -
- -
-
- [[common/businessDetails.html]] -
-
- [[bc-address-change/addresses.html]] -
- - diff --git a/legal-api/report-templates/bcAnnualReport.html b/legal-api/report-templates/bcAnnualReport.html deleted file mode 100644 index 8962c6ced4..0000000000 --- a/legal-api/report-templates/bcAnnualReport.html +++ /dev/null @@ -1,38 +0,0 @@ -[[macros.html]] - - - - Annual Report - - - [[common/style.html]] - {% if enable_sandbox %} - [[common/watermark.html]] - {% endif %} - - -
- - - - - - -
- -
-
- [[common/businessDetails.html]] -
-
- [[bc-annual-report/legalObligations.html]] -
- - diff --git a/legal-api/report-templates/bcDirectorChange.html b/legal-api/report-templates/bcDirectorChange.html deleted file mode 100644 index c35b898f52..0000000000 --- a/legal-api/report-templates/bcDirectorChange.html +++ /dev/null @@ -1,38 +0,0 @@ -[[macros.html]] - - - - Director Change - - - [[common/style.html]] - {% if enable_sandbox %} - [[common/watermark.html]] - {% endif %} - - -
- - - - - - -
- -
-
- [[common/businessDetails.html]] -
-
- [[bc-director-change/directors.html]] -
- - diff --git a/legal-api/report-templates/changeOfAddress.html b/legal-api/report-templates/changeOfAddress.html index ccc7ab5147..0ffacaac71 100644 --- a/legal-api/report-templates/changeOfAddress.html +++ b/legal-api/report-templates/changeOfAddress.html @@ -19,7 +19,7 @@
ADDRESS CHANGE
-
{{entityDescription}} - Business Corporations Act
+
{{entityDescription}} - {{ entityAct }}
@@ -32,7 +32,9 @@ [[common/businessDetails.html]]
[[addresses.html]] - [[certification.html]] + {% if business.legalType == 'CP' %} + [[certification.html]] + {% endif %}
diff --git a/legal-api/report-templates/changeOfDirectors.html b/legal-api/report-templates/changeOfDirectors.html index 7d650eee87..e19937b22b 100644 --- a/legal-api/report-templates/changeOfDirectors.html +++ b/legal-api/report-templates/changeOfDirectors.html @@ -19,7 +19,7 @@
DIRECTOR CHANGE
-
{{entityDescription}} - Business Corporations Act
+
{{entityDescription}} - {{ entityAct }}
@@ -32,7 +32,9 @@ [[common/businessDetails.html]]
[[directors.html]] - [[certification.html]] + {% if business.legalType == 'CP' %} + [[certification.html]] + {% endif %}
diff --git a/legal-api/report-templates/template-parts/addresses.html b/legal-api/report-templates/template-parts/addresses.html index d5e95f60b2..816eb88171 100644 --- a/legal-api/report-templates/template-parts/addresses.html +++ b/legal-api/report-templates/template-parts/addresses.html @@ -33,3 +33,42 @@ {% endif %} + +{% if recordsOfficeAddress is defined %} +
+
+
Records Office Information
+
+ + + + + + +{% endif %} diff --git a/legal-api/report-templates/template-parts/bc-address-change/addresses.html b/legal-api/report-templates/template-parts/bc-address-change/addresses.html deleted file mode 100644 index 7def33c8f4..0000000000 --- a/legal-api/report-templates/template-parts/bc-address-change/addresses.html +++ /dev/null @@ -1,74 +0,0 @@ -{% if registeredOfficeAddress is defined %} -
Registered Office Information
- - - - - - -{% endif %} - -{% if recordsOfficeAddress is defined %} -
-
-
Records Office Information
-
- - - - - - -{% endif %} diff --git a/legal-api/report-templates/template-parts/bc-director-change/directors.html b/legal-api/report-templates/template-parts/bc-director-change/directors.html deleted file mode 100644 index e84c23b22c..0000000000 --- a/legal-api/report-templates/template-parts/bc-director-change/directors.html +++ /dev/null @@ -1,169 +0,0 @@ -{% if listOfDirectors is defined %} -
New Directors Appointed or Elected
- - {% for director in listOfDirectors.directorsAppointed %} - - - - - - {% else %} - - - - {% endfor %} - - -
-
-
Ceased Directors
-
- - {% for director in listOfDirectors.directorsCeased %} - - - - - - {% else %} - - - - {% endfor %} - - -
-
-
All Directors as of {{ effective_date }}
-
- - {% for director in listOfDirectors.directors %} - {% if not director.cessationDate %} - - - - - - {% endif %} - {% else %} - - - - {% endfor %} - -{% endif %} diff --git a/legal-api/src/legal_api/reports/report.py b/legal-api/src/legal_api/reports/report.py index 9299f730a5..591f984f47 100644 --- a/legal-api/src/legal_api/reports/report.py +++ b/legal-api/src/legal_api/reports/report.py @@ -123,6 +123,13 @@ def _get_report(self, regenerate: bool = False): if response.status_code != HTTPStatus.OK: return jsonify(message=str(response.content)), response.status_code + elif self._filing.status not in [Filing.Status.WITHDRAWN.value, Filing.Status.COMPLETED.value]: + # some sections are available only when filing is completed. + return current_app.response_class( + response=response.content, + status=response.status_code, + mimetype="application/pdf" + ) if regenerate: response_drs = self._document_service.replace_filing_report( @@ -184,8 +191,6 @@ def _substitute_template_parts(template_code): "amalgamation/approvalType", "amalgamation/effectiveDate", "bc-annual-report/legalObligations", - "bc-address-change/addresses", - "bc-director-change/directors", "common/certificateFooter", "common/certificateLogo", "common/certificateRegistrarSignature", @@ -1608,37 +1613,19 @@ class ReportMeta: # pylint: disable=too-few-public-methods "reportType": ReportTypes.FILING.value }, "changeOfAddress": { - "hasDifferentTemplates": True, "filingDescription": "Change of Address", "reportType": ReportTypes.FILING.value, - "default": { - "fileName": "bcAddressChange" - }, - "CP": { - "fileName": "changeOfAddress" - } + "fileName": "changeOfAddress" }, "changeOfDirectors": { - "hasDifferentTemplates": True, "filingDescription": "Change of Directors", "reportType": ReportTypes.FILING.value, - "default": { - "fileName": "bcDirectorChange" - }, - "CP": { - "fileName": "changeOfDirectors" - } + "fileName": "changeOfDirectors" }, "annualReport": { - "hasDifferentTemplates": True, "filingDescription": "Annual Report", "reportType": ReportTypes.FILING.value, - "default": { - "fileName": "bcAnnualReport" - }, - "CP": { - "fileName": "annualReport" - } + "fileName": "annualReport" }, "changeOfName": { "filingDescription": "Change of Name", From b070d4729cee87b37d17bfe891ad1344a02127d1 Mon Sep 17 00:00:00 2001 From: Vysakh Menon Date: Tue, 16 Jun 2026 16:21:22 -0700 Subject: [PATCH 3/3] no message --- legal-api/report-templates/template-parts/addresses.html | 8 ++++---- legal-api/report-templates/template-parts/directors.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/legal-api/report-templates/template-parts/addresses.html b/legal-api/report-templates/template-parts/addresses.html index 816eb88171..9eb78e2c0c 100644 --- a/legal-api/report-templates/template-parts/addresses.html +++ b/legal-api/report-templates/template-parts/addresses.html @@ -4,7 +4,7 @@
- Mailing Address {% if 'addressChanged' in registeredOfficeAddress.mailingAddress.actions %}{{ labelNew() }}{% endif %} + Mailing Address {% if 'addressChanged' in registeredOfficeAddress.mailingAddress.actions %}{{ labelChanged() }}{% endif %}
{{ registeredOfficeAddress.mailingAddress.streetAddress }}
{{ registeredOfficeAddress.mailingAddress.streetAddressAdditional }}
@@ -18,7 +18,7 @@
- Delivery Address {% if 'addressChanged' in registeredOfficeAddress.deliveryAddress.actions %}{{ labelNew() }}{% endif %} + Delivery Address {% if 'addressChanged' in registeredOfficeAddress.deliveryAddress.actions %}{{ labelChanged() }}{% endif %}
{{ registeredOfficeAddress.deliveryAddress.streetAddress }}
{{ registeredOfficeAddress.deliveryAddress.streetAddressAdditional }}
@@ -43,7 +43,7 @@
- Mailing Address {% if 'addressChanged' in recordsOfficeAddress.mailingAddress.actions %}{{ labelNew() }}{% endif %} + Mailing Address {% if 'addressChanged' in recordsOfficeAddress.mailingAddress.actions %}{{ labelChanged() }}{% endif %}
{{ recordsOfficeAddress.mailingAddress.streetAddress }}
{{ recordsOfficeAddress.mailingAddress.streetAddressAdditional }}
@@ -57,7 +57,7 @@
- Delivery Address {% if 'addressChanged' in recordsOfficeAddress.deliveryAddress.actions %}{{ labelNew() }}{% endif %} + Delivery Address {% if 'addressChanged' in recordsOfficeAddress.deliveryAddress.actions %}{{ labelChanged() }}{% endif %}
{{ recordsOfficeAddress.deliveryAddress.streetAddress }}
{{ recordsOfficeAddress.deliveryAddress.streetAddressAdditional }}
diff --git a/legal-api/report-templates/template-parts/directors.html b/legal-api/report-templates/template-parts/directors.html index 06cde9edc5..bd9d371a06 100644 --- a/legal-api/report-templates/template-parts/directors.html +++ b/legal-api/report-templates/template-parts/directors.html @@ -137,7 +137,7 @@ {% if director.mailingAddress is defined %}
- Mailing Address {% if 'addressChanged' in director.actions %}{{ labelNew() }}{% endif %} + Mailing Address {% if 'addressChanged' in director.actions %}{{ labelChanged() }}{% endif %}
{{ director.mailingAddress.streetAddress }}
{{ director.mailingAddress.streetAddressAdditional }}
@@ -157,7 +157,7 @@
- Delivery Address {% if 'addressChanged' in director.actions %}{{ labelNew() }}{% endif %} + Delivery Address {% if 'addressChanged' in director.actions %}{{ labelChanged() }}{% endif %}
{{ director.deliveryAddress.streetAddress }}
{{ director.deliveryAddress.streetAddressAdditional }}