Skip to content

Commit

Permalink
PPR transition registration updates. (#45)
Browse files Browse the repository at this point in the history
* PPR transition registration updates.

Signed-off-by: Doug Lovett <[email protected]>

* PPR update searchQuery ind debtor name lengths.

Signed-off-by: Doug Lovett <[email protected]>

---------

Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Mar 15, 2023
1 parent 0894c79 commit a9ea858
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
15 changes: 14 additions & 1 deletion src/registry_schemas/schemas/ppr/financingStatement.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "string",
"maxLength": 2,
"enum": ["SA", "RL", "FR", "LT", "MH", "SG", "FL", "FA", "FS", "MR", "CC", "CT", "DP", "ET", "FO", "FT", "HR", "IP", "LO", "MI", "OT"
, "PG", "PS", "IT", "RA", "SS", "TL", "HN", "ML", "MN", "PN", "WL", "TF", "TA", "TG", "TM", "TO", "SV", "MD", "PT", "SC"],
, "PG", "PS", "IT", "RA", "SS", "TL", "HN", "ML", "MN", "PN", "WL", "TF", "TA", "TG", "TM", "MD", "PT", "SC", "TO", "SV"],
"description": "Specifies the type of Financing Statement. Includes all legacy registration types."
},
"clientReferenceId": {
Expand Down Expand Up @@ -122,6 +122,19 @@
"courtOrderInformation": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/ppr/courtOrder"
},
"transitionDescription": {
"type": "string",
"description": "For transition registrations, the description of the previous registration. Conditionally included in a response."
},
"transitionDate": {
"type": "string",
"format": "date-time",
"description": "For transition registrations, the date of the previous registration. Conditionally included in a response."
},
"transitionNumber": {
"type": "string",
"description": "For transition registrations, the identifier of the previous registration. Conditionally included in a response."
},
"payment": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/common/paymentReference"
}
Expand Down
6 changes: 3 additions & 3 deletions src/registry_schemas/schemas/ppr/searchQuery.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"properties": {
"first": {
"type": "string",
"maxLength": 30,
"maxLength": 50,
"description": "First name of debtor if search type is INDIVIDUAL_DEBTOR."
},
"second": {
"type": "string",
"maxLength": 30,
"maxLength": 50,
"description": "Second/middle name or initial of debtor if search type is INDIVIDUAL_DEBTOR."
},
"last": {
"type": "string",
"maxLength": 30,
"maxLength": 50,
"description": "Last name of debtor if search type is INDIVIDUAL_DEBTOR."
},
"business": {
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 @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '1.7.2' # pylint: disable=invalid-name
__version__ = '1.7.3' # pylint: disable=invalid-name
21 changes: 20 additions & 1 deletion tests/unit/ppr/test_financing_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
('MD', True),
('PT', True),
('SC', True),
('TO', True),
('SV', True),
('TO', True),
('XX', False),
]
# testdata pattern is ({other type description}, {is valid})
Expand Down Expand Up @@ -438,3 +438,22 @@ def test_authorization_received():
for err in errors:
print(err.message)
assert not is_valid


def test_valid_financing_response_transition():
"""Assert that the schema is performing as expected for a transition registration response."""
statement = copy.deepcopy(FINANCING_STATEMENT)
del statement['lifeInfinite']
del statement['lienAmount']
del statement['surrenderDate']
statement['transitionDescription'] = 'COMPANY ACT DOCUMENT'
statement['transitionDate'] = '1986-12-29T00:00:01-08:53'
statement['transitionNumber'] = 'BC0021615'
is_valid, errors = validate(statement, 'financingStatement', 'ppr')

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

assert is_valid
6 changes: 3 additions & 3 deletions tests/unit/ppr/test_search_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def test_invalid_search_query_firstname():
query = copy.deepcopy(SEARCH_QUERY)
del query['criteria']['value']
del query['criteria']['debtorName']['business']
query['criteria']['debtorName']['first'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
query['criteria']['debtorName']['first'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

is_valid, errors = validate(query, 'searchQuery', 'ppr')

Expand All @@ -261,7 +261,7 @@ def test_invalid_search_query_secondname():
query = copy.deepcopy(SEARCH_QUERY)
del query['criteria']['value']
del query['criteria']['debtorName']['business']
query['criteria']['debtorName']['second'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
query['criteria']['debtorName']['second'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

is_valid, errors = validate(query, 'searchQuery', 'ppr')

Expand All @@ -278,7 +278,7 @@ def test_invalid_search_query_lastname():
query = copy.deepcopy(SEARCH_QUERY)
del query['criteria']['value']
del query['criteria']['debtorName']['business']
query['criteria']['debtorName']['last'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
query['criteria']['debtorName']['last'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

is_valid, errors = validate(query, 'searchQuery', 'ppr')

Expand Down

0 comments on commit a9ea858

Please sign in to comment.