Skip to content

33372: Adjust share structure par values on outputs#4394

Merged
loneil merged 1 commit into
bcgov:mainfrom
loneil:33372shareStructureOutput
May 15, 2026
Merged

33372: Adjust share structure par values on outputs#4394
loneil merged 1 commit into
bcgov:mainfrom
loneil:33372shareStructureOutput

Conversation

@loneil
Copy link
Copy Markdown
Collaborator

@loneil loneil commented May 14, 2026

Issue #: /bcgov/entity#33372

Description of changes:
Formatting of Par Values to fix some minor issues and match UI.

Add a unit test for the jinja generation that tests these values.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

Copilot AI review requested due to automatic review settings May 14, 2026 22:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the share structure report template so par values for dollar currencies (USD, CAD, and the newly added AUD) render with a $ prefix, two decimal places, and thousands separators. Adds new template tests covering formatting edge cases.

Changes:

  • Added AUD to the set of "dollar" currencies and centralized the list in a Jinja variable.
  • Formatted numeric par values as $ {:,.2f}, with a fallback to the raw value when the par value cannot be parsed as a float.
  • Added unit tests rendering the share structure partial across currencies, par-value types, series, and empty inputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
legal-api/report-templates/template-parts/common/shareStructure.html Adds dollar-currency list; formats par values with commas and two decimals in both the share class and series sections.
legal-api/tests/unit/reports/templates/test_share_structure.py New tests for par-value formatting, currency handling, series inheritance, and empty/heading rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,5 @@
{% if shareClasses|length > 0 %}
{% set dollar_currencies = ['USD', 'CAD', 'AUD'] %}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This set matches what the Share Structure UIs use to determine.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread legal-api/report-templates/template-parts/common/shareStructure.html Outdated
Signed-off-by: Lucas <lucasoneil@gmail.com>
@loneil loneil force-pushed the 33372shareStructureOutput branch from f543e36 to 9bb51ed Compare May 14, 2026 23:33
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@loneil loneil requested review from kialj876, meawong and mruff-aeq May 14, 2026 23:38
Copy link
Copy Markdown
Collaborator

@kialj876 kialj876 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done - I like the new test suite

@loneil loneil merged commit 74285a8 into bcgov:main May 15, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants