Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions legal-api/src/legal_api/models/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class AssociationTypes(Enum):
"founding_date",
"identifier",
"in_liquidation",
"in_liquidation_date",
"jurisdiction",
"last_agm_date",
"last_ar_date",
Expand Down
2 changes: 1 addition & 1 deletion legal-api/src/legal_api/services/authz.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ def business_blocker_check(business: Business, is_ignore_draft_blockers: bool =

if business.in_liquidation:
business_blocker_checks[BusinessBlocker.IN_LIQUIDATION] = True
if LegislationDatetime.datenow() >= business.next_lr_min_date:
if business.next_lr_min_date and LegislationDatetime.datenow() >= business.next_lr_min_date:
business_blocker_checks[BusinessBlocker.MIN_LR_DATE_REACHED] = True

if has_notice_of_withdrawal_filing_blocker(business, is_ignore_draft_blockers):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import copy

import pytest
from psycopg2.tz import FixedOffsetTimezone
from datedelta import datedelta

from legal_api.models import Business
Expand All @@ -24,7 +25,7 @@
from tests.unit.models import factory_business

FOUNDING_DATE = datetime(2023, 3, 3)
IN_LIQUIDATION_DATE = datetime(2024, 6, 10)
IN_LIQUIDATION_DATE = datetime(2024, 6, 10, 0, 0, tzinfo=FixedOffsetTimezone(0))

@pytest.mark.parametrize('test_name, founding_date, in_liquidation_date, last_lr_year, expected_meta_data', [
('NOT_IN_LIQUIDATION', datetime.now(), None, None, {}),
Expand All @@ -39,6 +40,13 @@
'inLiquidationDate': IN_LIQUIDATION_DATE,
'lastLiquidationReportYear': 2025,
'nextLiquidationReportMinDate': date(2026, 3, 2)}
),
# Should not happen, but need to make sure it still returns for this case
('IN_LIQUIDATION_no_in_liquidation_date', FOUNDING_DATE, None, None,
{
'inLiquidationDate': None,
'lastLiquidationReportYear': None,
'nextLiquidationReportMinDate': None}
)
])
def test_check_business(session, test_name, founding_date, in_liquidation_date, last_lr_year, expected_meta_data):
Expand All @@ -50,6 +58,10 @@ def test_check_business(session, test_name, founding_date, in_liquidation_date,
in_liquidation_date=in_liquidation_date,
last_lr_year=last_lr_year)

if test_name != 'NOT_IN_LIQUIDATION':
business.in_liquidation = True
business.save()

result = check_business(business)

if test_name == 'NOT_IN_LIQUIDATION':
Expand Down
2 changes: 1 addition & 1 deletion python/common/business-registry-model/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "business-model"
version = "3.3.22"
version = "3.3.23"
description = ""
authors = [
{name = "thor",email = "1042854+thorwolpert@users.noreply.github.com"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ class AssociationTypes(Enum):
'founding_date',
'identifier',
'in_liquidation',
'in_liquidation_date',
'jurisdiction',
'last_agm_date',
'last_ar_date',
Expand Down