Skip to content

Commit

Permalink
Minor fee code, unit note report updates. (#1441)
Browse files Browse the repository at this point in the history
* Minor fee code, unit note report updates.

Signed-off-by: Doug Lovett <doug@diamante.ca>

* Check in update MHR API postman examples.

Signed-off-by: Doug Lovett <doug@diamante.ca>

---------

Signed-off-by: Doug Lovett <doug@diamante.ca>
  • Loading branch information
doug-lovett authored Jul 20, 2023
1 parent d8c8ce2 commit 9935a01
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if note is defined and note.givingNoticeParty is defined %}
{% if note is defined %}
<div class="no-page-break">
<div class="separator mt-5"></div>
<div class="section-title mt-3">
Expand All @@ -8,6 +8,7 @@
Person Giving Notice
{% endif %}
</div>
{% if note.givingNoticeParty is defined %}
<table class="section-data section-data-table-new mt-4" role="presentation">
<tr class="no-page-break">
<td class="col-33">
Expand Down Expand Up @@ -43,6 +44,23 @@
</div>
</td>
</tr>
</table>
</table>
{% else %}
<table class="section-data section-data-table-new mt-4" role="presentation">
<tr class="no-page-break">
<td class="col-33">
<div class="section-sub-title">N/A</div>
</td>
<td class="col-33">
<div class="section-sub-title">Address</div>
<div class="pt-2">N/A</div>
</td>
<td class="col-33">
<div class="section-sub-title">Phone Number</div>
<div class="pt-2">N/A</div>
</td>
</tr>
</table>
{% endif %}
</div>
{% endif %}
8 changes: 1 addition & 7 deletions mhr_api/report-templates/unitNoteV2.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,8 @@
{% endif %}
</div>

{% if note is defined and note.givingNoticeParty is defined %}
{% if note is defined %}
[[registration/givingNoticeParty.html]]
{% elif note is defined and note.documentType is defined and note.documentType == 'TAXN' %}
<div class="section-title mt-5">Collector</div>
<div class="section-data pt-3">N/A</div>
{% else %}
<div class="section-title mt-5">Person Giving Notice</div>
<div class="section-data pt-3">N/A</div>
{% endif %}

[[registration/submittingParty.html]]
Expand Down
12 changes: 11 additions & 1 deletion mhr_api/src/mhr_api/resources/v1/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def post_notes(mhr_number: str): # pylint: disable=too-many-return-statements,t
request_json,
account_id,
group,
TransactionTypes.UNIT_NOTE)
get_transaction_type(request_json))
current_app.logger.debug(f'building note response json for {mhr_number}')
registration.change_registrations = current_reg.change_registrations
response_json = registration.json
Expand All @@ -109,3 +109,13 @@ def post_notes(mhr_number: str): # pylint: disable=too-many-return-statements,t
return resource_utils.business_exception_response(exception)
except Exception as default_exception: # noqa: B902; return nicer default error
return resource_utils.default_exception_response(default_exception)


def get_transaction_type(request_json) -> str:
"""Try and obtain an optional boolean parameter value from the request parameters."""
tran_type: str = TransactionTypes.UNIT_NOTE
if request_json.get('note') and request_json['note'].get('documentType', '') == MhrDocumentTypes.TAXN:
tran_type = TransactionTypes.UNIT_NOTE_TAXN
elif request_json.get('note') and request_json['note'].get('documentType', '') == MhrDocumentTypes.REG_102:
tran_type = TransactionTypes.UNIT_NOTE_102
return tran_type
3 changes: 3 additions & 0 deletions mhr_api/src/mhr_api/services/payment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ class TransactionTypes(str, Enum):
TRANSPORT_PERMIT = 'TRANSPORT_PERMIT'
TRANSPORT_PERMIT_EXT = 'TRANSPORT_PERMIT_EXT'
UNIT_NOTE = 'UNIT_NOTE'
UNIT_NOTE_TAXN = 'UNIT_NOTE_TAXN'
UNIT_NOTE_102 = 'UNIT_NOTE_102'
DECAL_REPLACE = 'DECAL_REPLACE'
5 changes: 4 additions & 1 deletion mhr_api/src/mhr_api/services/payment/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
'EXEMPTION_NON_RES': 'EXEMN',
'TRANSPORT_PERMIT': 'TRAPP',
'TRANSPORT_PERMIT_EXT': 'TRAPP',
'UNIT_NOTE': 'CCONT'
'UNIT_NOTE': 'CCONT',
'UNIT_NOTE_TAXN': 'TXSNT',
'UNIT_NOTE_102': 'MHDEC',
'DECAL_REPLACE': 'MHDEC'
}

# Mapping from normal filing type to staff version of filing type
Expand Down
2 changes: 1 addition & 1 deletion mhr_api/src/mhr_api/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '1.4.5' # pylint: disable=invalid-name
__version__ = '1.4.6' # pylint: disable=invalid-name
108 changes: 105 additions & 3 deletions mhr_api/tests/postman/mhr-api-unit.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,108 @@
}
]
},
{
"name": "admin registrations",
"item": [
{
"name": "Create MH NRED Admin Reg",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"type": "text",
"value": "application/json"
},
{
"key": "Account-Id",
"type": "text",
"value": "{{account_id}}"
},
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{jwt}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"clientReferenceId\": \"UT-ADMIN-NRED-TAXN-006\",\n \"attentionReference\": \"JANE GIBSON\",\n \"documentType\": \"NRED\",\n \"updateDocumentId\": \"80888225\",\n \"submittingParty\": {\n \"businessName\": \"ABC SEARCHING COMPANY\",\n \"address\": {\n \"street\": \"222 SUMMER STREET\",\n \"city\": \"VICTORIA\",\n \"region\": \"BC\",\n \"country\": \"CA\",\n \"postalCode\": \"V8W 2V8\"\n },\n \"emailAddress\": \"bsmith@abc-search.com\"\n },\n \"note\": {\n \"documentType\": \"NRED\",\n \"documentId\": \"80888227\",\n \"remarks\": \"UT NRED CANCEL A NOTICE PURSUANT TO SECTION 413 OF THE LOCAL GOVERNMENT ACT WAS FILED\",\n \"givingNoticeParty\": {\n\t \"businessName\": \"FRONTIER LAW\",\n\t \"address\": {\n\t \"street\": \"#101-10343 100 AVENUE\",\n\t \"city\": \"FORT ST. JOHN\",\n\t \"region\": \"BC\",\n\t \"country\": \"CA\",\n\t \"postalCode\": \"V1J 1Y8\"\n\t },\n \"phoneNumber\": \"2507851924\"\n }\n }\n}\n"
},
"url": {
"raw": "{{base_url}}/api/v1/admin-registrations/106830",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"admin-registrations",
"106830"
]
},
"description": "Search step 1 submit a query example: search by a Financing Statement registration number which returns no results."
},
"response": []
},
{
"name": "Create EXRE Admin Reg",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"type": "text",
"value": "application/json"
},
{
"key": "Account-Id",
"type": "text",
"value": "{{account_id}}"
},
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{jwt}}",
"type": "text"
},
{
"key": "Staff-Account-Id",
"value": "{{staff_account_id}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"clientReferenceId\": \"UT-ADMIN-EXRE-004\",\n \"attentionReference\": \"JANE GIBSON\",\n \"documentType\": \"EXRE\",\n \"updateDocumentId\": \"80888183\",\n \"documentId\": \"80888228\",\n \"submittingParty\": {\n \"businessName\": \"ABC SEARCHING COMPANY\",\n \"address\": {\n \"street\": \"222 SUMMER STREET\",\n \"city\": \"VICTORIA\",\n \"region\": \"BC\",\n \"country\": \"CA\",\n \"postalCode\": \"V8W 2V8\"\n },\n \"emailAddress\": \"bsmith@abc-search.com\"\n }\n}\n"
},
"url": {
"raw": "{{base_url}}/api/v1/admin-registrations/106797",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"admin-registrations",
"106797"
]
},
"description": "Search step 1 submit a query example: search by a Financing Statement registration number which returns no results."
},
"response": []
}
]
},
{
"name": "documents",
"item": [
Expand Down Expand Up @@ -1665,11 +1767,11 @@
"variable": [
{
"key": "apikey",
"value": "Provide"
"value": "PROVIDE"
},
{
"key": "account_id",
"value": "Provide"
"value": "ppr_staff"
},
{
"key": "base_url_prism",
Expand All @@ -1682,7 +1784,7 @@
},
{
"key": "jwt",
"value": "Provide",
"value": "PROVIDE",
"type": "string"
},
{
Expand Down
5 changes: 4 additions & 1 deletion mhr_api/tests/unit/services/test_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@
('MHR Registration no trans id', TransactionTypes.REGISTRATION, None, 'UT-00001', 1),
('MHR Transfer', TransactionTypes.TRANSFER, '1234', 'UT-00001', 1),
('MHR Transport Permit', TransactionTypes.TRANSPORT_PERMIT, '1234', 'UT-00001', 1),
('MHR Transport Permit Extension', TransactionTypes.TRANSPORT_PERMIT_EXT, '1234', 'UT-00001', 1)
('MHR Transport Permit Extension', TransactionTypes.TRANSPORT_PERMIT_EXT, '1234', 'UT-00001', 1),
('MHR Decal Replacement', TransactionTypes.DECAL_REPLACE, '1234', 'UT-00001', 1),
('MHR Unit Note 102', TransactionTypes.UNIT_NOTE_102, '1234', 'UT-00001', 1),
('MHR Unit Note TAXN', TransactionTypes.UNIT_NOTE_TAXN, '1234', 'UT-00001', 1)
]
# testdata pattern is ({type}, {trans_id}, {client_id}, {routingSlip}, {bcolNum}, {datNum}, {waiveFees}, {priority})
TEST_PAYMENT_DATA_STAFF = [
Expand Down

0 comments on commit 9935a01

Please sign in to comment.