Skip to content

Commit

Permalink
MHR API adminRegistration schema updates. (#52)
Browse files Browse the repository at this point in the history
* MHR API adminRegistration schema updates.

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

* MHR API add CANCELLED registration status type.

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

---------

Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Jul 19, 2023
1 parent a68c6fa commit b7613ae
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 9 deletions.
34 changes: 33 additions & 1 deletion src/registry_schemas/example_data/mhr/schema_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

ADMIN_REGISTRATION = {
'mhrNumber': '004816',
'documentDescription': 'NOTICE OF REDEMPTION',
'documentId': '90051583',
'documentRegistrationNumber': '00504168',
'documentType': 'NRED',
'registrationType': 'REG_STAFF_ADMIN',
'clientReferenceId': 'EX-NRED-001',
'attentionReference': 'JOHN SMITH',
Expand All @@ -40,8 +44,36 @@
'phoneNumber': '6044620279',
'emailAddress': '[email protected]'
},
'documentType': 'NRED',
'updateDocumentId': '62754188',
'note': {
'documentType': 'NRED',
'documentId': '90051583',
'documentRegistrationNumber': '00504168',
'documentDescription': 'NOTICE OF CAUTION',
'createDateTime': '2023-02-21T18:56:00+00:00',
'effectiveDateTime': '2023-02-21T18:56:00+00:00',
'cancelledDocumentDescription': 'NOTICE OF TAX SALE',
'cancelledDocumentRegistrationNumber': '00102478',
'cancelledDocumentType': 'TAXN',
'remarks': 'NRED CANCEL A NOTICE PURSUANT TO SECTION 413 OF THE LOCAL GOVERNMENT ACT WAS FILED',
'givingNoticeParty': {
'personName': {
'first': 'JOHNNY',
'middle': 'B',
'last': 'SMITH'
},
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'BC',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'phoneNumber': '2504930122'
},
'status': 'ACTIVE',
'destroyed': False
},
'payment': {
'receipt': '/pay/api/v1/payment-requests/2198744/receipts',
'invoiceId': '2198744'
Expand Down
21 changes: 20 additions & 1 deletion src/registry_schemas/schemas/mhr/adminRegistration.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@
"maxLength": 6,
"description": "Unique manufactured home registration number assigned by the Manufactured Home Registry when a registration is created."
},
"documentId": {
"type": [ "string", "null" ],
"maxLength": 8,
"minLength": 8,
"description": "Unique registration document ID/number assigned by the Manufactured Home Registry."
},
"documentRegistrationNumber": {
"type": [ "string", "null" ],
"maxLength": 8,
"description": "The document registration number that uniquely identifies a registration."
},
"documentDescription": {
"type": [ "string", "null" ],
"maxLength": 100,
"description": "Included in a response as a description of the registration report document."
},
"registrationType": {
"type": "string",
"maxLength": 20,
Expand All @@ -36,13 +52,16 @@
"documentType": {
"type": "string",
"maxLength": 20,
"enum": ["COU", "COUR", "EXRE", "FZE", "NREG", "THAW", "ABAN", "ATTA", "ADDI", "BANK", "COMP", "CONF", "DNCH", "FORE", "GENT", "MAID", "MAIL", "MARR", "MEAM", "NAMV", "PUBA", "REBU", "REIV", "REPV", "SZL", "TAXS", "VEST", "WHAL"]
"enum": ["COU", "COUR", "EXRE", "FZE", "NRED", "THAW", "ABAN", "ATTA", "ADDI", "BANK", "COMP", "CONF", "DNCH", "FORE", "GENT", "MAID", "MAIL", "MARR", "MEAM", "NAMV", "PUBA", "REBU", "REIV", "REPV", "SZL", "TAXS", "VEST", "WHAL"]
},
"updateDocumentId": {
"type": [ "string", "null" ],
"maxLength": 8,
"description": "Only required with NRED and COUR document type requests. It is the document ID of a previously created registration that is being cancelled or updated."
},
"note": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/mhr/note"
},
"payment": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/common/paymentReference"
}
Expand Down
2 changes: 1 addition & 1 deletion src/registry_schemas/schemas/mhr/registration.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"status": {
"type": [ "string", "null" ],
"maxLength": 20,
"enum": ["ACTIVE", "DRAFT", "EXEMPT", "FROZEN", "HISTORICAL"],
"enum": ["ACTIVE", "DRAFT", "EXEMPT", "FROZEN", "HISTORICAL", "CANCELLED"],
"description": "The status of the registration. ACTIVE - registered; DRAFT; FROZEN; EXEMPT; HISTORICAL - cancelled. FROZEN is a temporary state where only BC Registries staff can make a change to the manufactured home."
},
"clientReferenceId": {
Expand Down
4 changes: 2 additions & 2 deletions src/registry_schemas/schemas/mhr/registrationSummary.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"statusType": {
"type": "string",
"maxLength": 20,
"enum": ["ACTIVE", "DRAFT", "EXEMPT", "FROZEN", "HISTORICAL"],
"description": "The status of the registration. ACTIVE - registered; DRAFT; EXEMPT; FROZEN; HISTORICAL - cancelled. FROZEN is a temporary state where only BC Registries staff can make a change to the manufactured home."
"enum": ["ACTIVE", "DRAFT", "EXEMPT", "FROZEN", "HISTORICAL", "CANCELLED"],
"description": "The status of the registration. ACTIVE - registered; DRAFT; EXEMPT; FROZEN; CANCELLED or HISTORICAL - cancelled. FROZEN is a temporary state where only BC Registries staff can make a change to the manufactured home."
},
"path": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions src/registry_schemas/schemas/mhr/searchSummary.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"status": {
"type": "string",
"maxLength": 20,
"enum": ["ACTIVE", "EXEMPT", "FROZEN", "HISTORICAL"],
"description": "The status of a manufactured home registration: one of ACTIVE, EXEMPT, FROZEN, or HISTORICAL."
"enum": ["ACTIVE", "EXEMPT", "FROZEN", "HISTORICAL", "CANCELLED"],
"description": "The status of a manufactured home registration: one of ACTIVE, CANCELLED, EXEMPT, FROZEN, or HISTORICAL."
},
"createDateTime": {
"type": "string",
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.8' # pylint: disable=invalid-name
__version__ = '1.7.9' # pylint: disable=invalid-name
3 changes: 2 additions & 1 deletion tests/unit/mhr/test_admin_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
LONG_CLIENT_REF = '012345678901234567890123456789012345678901234567890'
# testdata pattern is ({desc},{valid},{doc_type},{has_submitting},{is_request},{client_ref}, {attention})
TEST_DATA = [
('Valid request', True, 'COUR', True, True, None, None),
('Valid request COUR', True, 'COUR', True, True, None, None),
('Valid request NRED', True, 'COUR', 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

0 comments on commit b7613ae

Please sign in to comment.