33372: Adjust share structure par values on outputs#4394
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
AUDto 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.
loneil
commented
May 14, 2026
| @@ -1,4 +1,5 @@ | |||
| {% if shareClasses|length > 0 %} | |||
| {% set dollar_currencies = ['USD', 'CAD', 'AUD'] %} | |||
Collaborator
Author
There was a problem hiding this comment.
This set matches what the Share Structure UIs use to determine.
Signed-off-by: Lucas <lucasoneil@gmail.com>
f543e36 to
9bb51ed
Compare
|
kialj876
approved these changes
May 15, 2026
Collaborator
kialj876
left a comment
There was a problem hiding this comment.
Nicely done - I like the new test suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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).