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

17796 Allow firm registration for single name user/account #144

Merged
merged 8 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
26 changes: 24 additions & 2 deletions src/registry_schemas/schemas/party.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"properties": {
"partyType": { "const": "person" }
},
"required": ["firstName", "lastName"]
"required": ["lastName"]
},
{
"properties": {
Expand Down Expand Up @@ -119,7 +119,29 @@
"officer",
"roles",
"mailingAddress"
]
],
"if": {
thorwolpert marked this conversation as resolved.
Show resolved Hide resolved
"properties":{
"officer": {
"type": "object",
"properties": {
"partyType": { "enum": ["person"] }
},
"required":["partyType"]
}
}
},
"then": {
"properties": {
"officer": {
"type": "object",
"properties": {
"lastName": { "minLength": 1 }
},
"required": ["lastName"]
}
}
}
}
},
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion src/registry_schemas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"""


__version__ = '2.18.11' # pylint: disable=invalid-name
__version__ = '2.18.12' # pylint: disable=invalid-name
25 changes: 25 additions & 0 deletions tests/unit/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,28 @@ def test_validate_invalid_court_orders(invalid_court_order):
print(errors)

assert not is_valid

@pytest.mark.parametrize(
'first_name, last_name, expected', [
('Joe', 'Swanson', True),
('', 'Swanson', True),
('Joe', '', False),
('', '', False),
('', 'asdfghasdfghasdfghasdfghasdfghasdfgh', False)
]
)
def test_validate_single_name(first_name, last_name, expected):
registration_json = copy.deepcopy(REGISTRATION)
registration_json['parties'][0]['officer']['firstName'] = first_name
registration_json['parties'][0]['officer']['lastName'] = last_name
del registration_json['parties'][0]['roles'][1]
legal_filing = {'registration': registration_json}

is_valid, errors = validate(legal_filing, 'registration')

if errors:
for err in errors:
print(err.message)
print(errors)

assert is_valid == expected
Loading