Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0fee0d

Browse files
authored
Merge pull request #4759 from meawong/34729-Add-Resulting-Identifier-for-FED-Amalg-Warning
34729 - Add Amalg Temp Business Identifier
2 parents 6a3bb4d + 9a5d37f commit f0fee0d

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

legal-api/src/legal_api/services/warnings/business/business_checks/corps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def check_amalgamating_business(business: Business, is_staff: bool = False) -> l
6969
warning["data"]["resultingBusinessName"] = resulting_business_name
7070
if is_staff:
7171
warning["data"]["filingId"] = filing.id
72+
warning["data"]["resultingBusinessIdentifier"] = filing.filing_json["filing"]["business"]["identifier"]
7273
result.append(warning)
7374

7475
return result

legal-api/tests/unit/services/warnings/business/business_checks/test_corps.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def test_check_business(session, has_amalgamation, expected_warning):
3737
"legalName": "NAMED AMALG CORP.",
3838
"legalType": "BC"
3939
}
40+
},
41+
"business": {
42+
"identifier": "T987654321",
43+
"legalType": "BC"
4044
}
4145
}
4246
}
@@ -63,6 +67,7 @@ def test_check_business(session, has_amalgamation, expected_warning):
6367
assert warning['data']['filingId'] == "filing-id"
6468
assert warning['data']['amalgamatingBusinesses'] == [{"identifier": "BC7654321"}]
6569
assert warning['data']['resultingBusinessName'] == "NAMED AMALG CORP."
70+
assert warning['data']['resultingBusinessIdentifier'] == "T987654321"
6671
else:
6772
assert len(result) == 0
6873

@@ -88,6 +93,10 @@ def test_check_business_amalgamation_resulting_name(session, name_request, expec
8893
"amalgamationApplication": {
8994
"amalgamatingBusinesses": [{"identifier": "BC7654321"}],
9095
"nameRequest": name_request
96+
},
97+
"business": {
98+
"identifier": "T987654321",
99+
"legalType": "BC"
91100
}
92101
}
93102
}
@@ -104,7 +113,7 @@ def test_check_business_amalgamation_resulting_name(session, name_request, expec
104113

105114

106115
def test_check_business_excludes_filing_id_for_non_staff(session):
107-
"""Test that filing ids are only included for staff users."""
116+
"""Test that filing ids and the resulting business identifier are only included for staff users."""
108117
business = factory_business(identifier="BC1234567")
109118
mock_filing = Mock(
110119
id="filing-id",
@@ -118,6 +127,10 @@ def test_check_business_excludes_filing_id_for_non_staff(session):
118127
"legalName": "NAMED AMALG CORP.",
119128
"legalType": "BC"
120129
}
130+
},
131+
"business": {
132+
"identifier": "T987654321",
133+
"legalType": "BC"
121134
}
122135
}
123136
}
@@ -131,3 +144,5 @@ def test_check_business_excludes_filing_id_for_non_staff(session):
131144
"amalgamatingBusinesses": [{"identifier": "BC7654321"}],
132145
"resultingBusinessName": "NAMED AMALG CORP."
133146
}
147+
assert 'filingId' not in warning['data']
148+
assert 'resultingBusinessIdentifier' not in warning['data']

0 commit comments

Comments
 (0)