Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20148 remove operating name #2565

Merged
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: 0 additions & 1 deletion legal-api/src/legal_api/models/alternate_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ def _slim_json(self):
else None
),
"nameType": self.name_type.name,
"operatingName": self.name, # will be removed in the future
}
],
}
Expand Down
1 change: 0 additions & 1 deletion legal-api/src/legal_api/models/legal_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ def alternate_names_json(self):
if alternate_name.business_start_date
else None,
"nameType": alternate_name.name_type.name,
"operatingName": alternate_name.name, # will be removed in the future
}
)
else:
Expand Down
2 changes: 1 addition & 1 deletion legal-api/src/legal_api/resources/v2/internal_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create_registrars_notation_filing(business: any, user: User, old_bn: str):
"header": {"name": "registrarsNotation", "date": date.today().isoformat(), "certifiedBy": "system"},
"business": {"identifier": business.identifier, "legalType": business.entity_type},
"registrarsNotation": {
"orderDetails": f"Business Number changed from {old_bn} to {new_bn }"
"orderDetails": f"Business Number changed from {old_bn} to {new_bn}"
+ " based on a request from the CRA."
},
}
Expand Down
20 changes: 7 additions & 13 deletions legal-api/tests/unit/models/test_legal_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,14 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"entityType": "SP",
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
"businessStartDate": ALTERNATE_NAME_1_START_DATE_ISO,
"startDate": ALTERNATE_NAME_1_REGISTERED_DATE,
},
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"entityType": "GP",
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
"businessStartDate": ALTERNATE_NAME_2_START_DATE_ISO,
"startDate": ALTERNATE_NAME_2_REGISTERED_DATE,
},
Expand All @@ -762,7 +762,6 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
[
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"operatingName": ALTERNATE_NAME_1,
"entityType": "SP",
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_1_START_DATE,
Expand All @@ -771,7 +770,6 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
},
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"operatingName": ALTERNATE_NAME_2,
"entityType": "GP",
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_2_START_DATE,
Expand All @@ -796,7 +794,7 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"entityType": "SP",
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
"businessStartDate": ALTERNATE_NAME_1_START_DATE_ISO,
"startDate": ALTERNATE_NAME_1_REGISTERED_DATE,
}
Expand All @@ -805,7 +803,6 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
[
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"operatingName": ALTERNATE_NAME_1,
"entityType": "SP",
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_1_START_DATE,
Expand All @@ -830,7 +827,7 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"entityType": "GP",
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
"businessStartDate": ALTERNATE_NAME_2_START_DATE_ISO,
"startDate": ALTERNATE_NAME_2_REGISTERED_DATE,
}
Expand All @@ -839,7 +836,6 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
[
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"operatingName": ALTERNATE_NAME_2,
"entityType": "GP",
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_2_START_DATE,
Expand Down Expand Up @@ -867,14 +863,14 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"entityType": "GP",
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
"businessStartDate": ALTERNATE_NAME_1_START_DATE_ISO,
"startDate": ALTERNATE_NAME_1_REGISTERED_DATE,
},
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"entityType": "SP",
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
"businessStartDate": ALTERNATE_NAME_2_START_DATE_ISO,
"startDate": ALTERNATE_NAME_2_REGISTERED_DATE,
},
Expand All @@ -883,7 +879,6 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
[
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"operatingName": ALTERNATE_NAME_1,
"entityType": "GP",
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_1_START_DATE,
Expand All @@ -892,7 +887,6 @@ def test_business_name(session, entity_type, legal_name, expected_business_name)
},
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"operatingName": ALTERNATE_NAME_2,
"entityType": "SP",
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_2_START_DATE,
Expand Down Expand Up @@ -939,7 +933,7 @@ def test_alternate_names(session, test_name, legal_entities_info, alternate_name
alternate_name = AlternateName(
identifier=alternate_name_identifier,
name_type=AlternateName.NameType.DBA,
name=alternate_name_info["operatingName"],
name=alternate_name_info["name"],
bn15="111111100BC1111",
start_date=start_date,
business_start_date=business_start_date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ def test_update_ar_with_a_missing_filing_id_fails(session, client, jwt):
filings = factory_completed_filing(legal_entity, ar)

rv = client.put(
f"/api/v2/businesses/{identifier}/filings/{filings.id+1}",
f"/api/v2/businesses/{identifier}/filings/{filings.id + 1}",
json=ar,
headers=create_header(jwt, [STAFF_ROLE], identifier),
)
Expand All @@ -989,7 +989,7 @@ def test_update_ar_with_a_missing_business_id_fails(session, client, jwt):
identifier = "CP0000001"

rv = client.put(
f"/api/v2/businesses/{identifier}/filings/{filings.id+1}",
f"/api/v2/businesses/{identifier}/filings/{filings.id + 1}",
json=ar,
headers=create_header(jwt, [STAFF_ROLE], identifier),
)
Expand All @@ -1006,7 +1006,7 @@ def test_update_ar_with_missing_json_body_fails(session, client, jwt):
filings = factory_filing(b, ANNUAL_REPORT)

rv = client.put(
f"/api/v2/businesses/{identifier}/filings/{filings.id+1}",
f"/api/v2/businesses/{identifier}/filings/{filings.id + 1}",
json=None,
headers=create_header(jwt, [STAFF_ROLE], identifier),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ def _slim_json(self):
if self.business_start_date
else None
),
"nameType": self.name_type.name,
"operatingName": self.name, # will be removed in the future
"nameType": self.name_type.name
}
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ def alternate_names_json(self):
)
if alternate_name.business_start_date
else None,
"nameType": alternate_name.name_type.name,
"operatingName": alternate_name.name, # will be removed in the future
"nameType": alternate_name.name_type.name
}
)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -956,14 +956,14 @@ def test_business_name(
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"entityType": "SP",
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"startDate": ALTERNATE_NAME_1_START_DATE,
},
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"entityType": "GP",
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"startDate": ALTERNATE_NAME_2_START_DATE,
},
Expand All @@ -975,14 +975,14 @@ def test_business_name(
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_1_START_DATE,
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
},
{
"entityType": "GP",
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_2_START_DATE,
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
},
],
),
Expand All @@ -1002,7 +1002,7 @@ def test_business_name(
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"entityType": "SP",
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"startDate": ALTERNATE_NAME_1_START_DATE,
}
Expand All @@ -1014,7 +1014,7 @@ def test_business_name(
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_1_START_DATE,
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
}
],
),
Expand All @@ -1034,7 +1034,7 @@ def test_business_name(
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"entityType": "GP",
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"startDate": ALTERNATE_NAME_2_START_DATE,
}
Expand All @@ -1046,7 +1046,7 @@ def test_business_name(
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_2_START_DATE,
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
}
],
),
Expand All @@ -1069,14 +1069,14 @@ def test_business_name(
{
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"entityType": "GP",
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"startDate": ALTERNATE_NAME_1_START_DATE,
},
{
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"entityType": "SP",
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"startDate": ALTERNATE_NAME_2_START_DATE,
},
Expand All @@ -1088,14 +1088,14 @@ def test_business_name(
"identifier": ALTERNATE_NAME_1_IDENTIFIER,
"nameRegisteredDate": ALTERNATE_NAME_1_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_1_START_DATE,
"operatingName": ALTERNATE_NAME_1,
"name": ALTERNATE_NAME_1,
},
{
"entityType": "SP",
"identifier": ALTERNATE_NAME_2_IDENTIFIER,
"nameRegisteredDate": ALTERNATE_NAME_2_REGISTERED_DATE,
"nameStartDate": ALTERNATE_NAME_2_START_DATE,
"operatingName": ALTERNATE_NAME_2,
"name": ALTERNATE_NAME_2,
},
],
),
Expand Down Expand Up @@ -1151,7 +1151,7 @@ def test_alternate_names(
alternate_name = AlternateName(
identifier=alternate_name_identifier,
name_type=AlternateName.NameType.OPERATING,
name=alternate_name_info["operatingName"],
name=alternate_name_info["name"],
bn15="111111100BC1111",
start_date=start_date,
legal_entity_id=le.id,
Expand Down Expand Up @@ -1270,7 +1270,7 @@ def test_sole_proprietor(

name_dict = {
"identifier": "FM1234567",
"operatingName": "Harry Lime Questionable Goods Broker",
"name": "Harry Lime Questionable Goods Broker",
"entityType": "person",
"nameStartDate": "2023-10-29",
}
Expand Down Expand Up @@ -1339,7 +1339,7 @@ def test_find_by_FM_identifier(

name_dict = {
"identifier": "FM1234567",
"operatingName": "Harry Lime Questionable Goods Broker",
"name": "Harry Lime Questionable Goods Broker",
"entityType": "person",
"nameStartDate": "2023-10-29",
}
Expand Down Expand Up @@ -1409,7 +1409,7 @@ def test_find_by_FM_name(

name_dict = {
"identifier": "FM1234567",
"operatingName": "Harry Lime Questionable Goods Broker",
"name": "Harry Lime Questionable Goods Broker",
"entityType": "person",
"nameStartDate": "2023-10-29",
}
Expand Down
Loading