Skip to content

Commit

Permalink
MHR schema updates for staff change location. (#60)
Browse files Browse the repository at this point in the history
* MHR schema updates for staff change location.

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

* MHR schema updates for staff change location.

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

---------

Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Nov 2, 2023
1 parent 1706d76 commit cd8d965
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
17 changes: 15 additions & 2 deletions src/registry_schemas/schemas/mhr/adminRegistration.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
},
"documentType": {
"type": "string",
"maxLength": 20,
"enum": ["COU", "COUR", "EXRE", "FZE", "NCAN", "NRED", "THAW", "ABAN", "ATTA", "ADDI", "BANK", "COMP", "CONF", "DNCH", "FORE", "GENT", "MAID", "MAIL", "MARR", "MEAM", "NAMV", "PUBA", "REBU", "REIV", "REPV", "SZL", "TAXS", "VEST", "WHAL"]
"maxLength": 20 ,
"enum": ["ADDI", "ATTA", "COMP", "CONF", "COUR", "DNCH", "EXRE", "FZE", "INTE", "INTW", "MAID", "MAIL", "MARR", "MEAM", "NAMV", "NCAN", "NRED", "PDEC", "PUBA", "REBU", "REGC", "STAT", "THAW", "WHAL"]
},
"updateDocumentId": {
"type": [ "string", "null" ],
Expand All @@ -62,6 +62,19 @@
"note": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/mhr/note"
},
"ownerGroups": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/mhr/ownerGroup"
}
},
"location": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/mhr/location"
},
"description": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/mhr/description"
},
"payment": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/common/paymentReference"
}
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.8.6' # pylint: disable=invalid-name
__version__ = '1.8.7' # pylint: disable=invalid-name
6 changes: 5 additions & 1 deletion tests/unit/mhr/test_admin_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pytest

from registry_schemas import validate
from registry_schemas.example_data.mhr import ADMIN_REGISTRATION
from registry_schemas.example_data.mhr import ADMIN_REGISTRATION, LOCATION


LONG_CLIENT_REF = '012345678901234567890123456789012345678901234567890'
Expand All @@ -26,6 +26,8 @@
('Valid request COUR', True, 'COUR', True, True, None, None),
('Valid request NRED', True, 'NRED', True, True, None, None),
('Valid request NCAN', True, 'NCAN', True, True, None, None),
('Valid request REGC', True, 'REGC', True, True, None, None),
('Valid request STAT', True, 'STAT', True, True, None, None),
('Valid response', True, 'THAW', True, False, '1234', 'JOHN SMITH'),
('Invalid client ref', False, 'NRED', True, True, LONG_CLIENT_REF, None),
('Invalid attention', False, 'EXRE', True, True, None, LONG_CLIENT_REF),
Expand Down Expand Up @@ -61,6 +63,8 @@ def test_note_registration(desc, valid, doc_type, has_sub, is_request, client_re
del data['registrationType']
if desc == 'Invalid update doc id':
data['updateDocumentId'] = '123456789'
elif desc in ('Valid request REGC', 'Valid request STAT'):
data['location'] = copy.deepcopy(LOCATION)
is_valid, errors = validate(data, 'adminRegistration', 'mhr')

if errors:
Expand Down

0 comments on commit cd8d965

Please sign in to comment.