Skip to content

Commit

Permalink
22673 - Hide involuntary dissolution ledger item (bcgov#2931)
Browse files Browse the repository at this point in the history
* 22673 - Hide involuntary dissolution ledger item

* refactored the code to make it cleaner
  • Loading branch information
JazzarKarim authored Aug 20, 2024
1 parent acec461 commit 0b7625b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion legal-api/src/legal_api/core/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ def _add_ledger_order(filing: FilingStorage, ledger_filing: dict) -> dict:
@staticmethod
def _is_display_ledger(filing: FilingStorage) -> bool:
"""Return boolean that display the ledger."""
return filing.filing_type != Filing.FilingTypes.ADMIN_FREEZE
# If filing is NOT an admin freeze or involuntary dissolution, we will display it on ledger
return not (
filing.filing_type == Filing.FilingTypes.ADMIN_FREEZE or
(
filing.filing_type == Filing.FilingTypes.DISSOLUTION and
filing.filing_sub_type == 'involuntary'
)
)

@staticmethod
def get_document_list(business, # pylint: disable=too-many-locals disable=too-many-branches
Expand Down
7 changes: 7 additions & 0 deletions legal-api/tests/unit/core/test_filing_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ def test_common_ledger_items(session):
assert common_ledger_items['documentsLink'] is not None
assert common_ledger_items['displayLedger'] is True

filing['filing']['dissolution']['dissolutionType'] = 'involuntary'
completed_filing = \
factory_completed_filing(business, filing, filing_date=founding_date + datedelta.datedelta(months=1))
common_ledger_items = CoreFiling.common_ledger_items(identifier, completed_filing)
assert common_ledger_items['documentsLink'] is not None
assert common_ledger_items['displayLedger'] is False

filing['filing']['header']['name'] = 'adminFreeze'
completed_filing = \
factory_completed_filing(business, filing, filing_date=founding_date + datedelta.datedelta(months=1), filing_type='adminFreeze')
Expand Down

0 comments on commit 0b7625b

Please sign in to comment.