forked from bcgov/STRR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: API changes for business as a host (bcgov#257)
* feat: API changes for business as a host * no message
- Loading branch information
1 parent
a8fc071
commit cdb2ea5
Showing
10 changed files
with
278 additions
and
2 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
strr-api/migrations/versions/20241031_2216_1ddad4ce0e21_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
"""empty message | ||
Revision ID: 1ddad4ce0e21 | ||
Revises: 14f84cc80367 | ||
Create Date: 2024-10-31 22:16:54.409155 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1ddad4ce0e21' | ||
down_revision = '14f84cc80367' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
contacttype = postgresql.ENUM('INDIVIDUAL', 'BUSINESS', name='contacttype') | ||
contacttype.create(op.get_bind(), checkfirst=True) | ||
|
||
with op.batch_alter_table('property_contacts', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('contact_type', contacttype, nullable=True)) | ||
batch_op.add_column(sa.Column('business_legal_name', sa.String(length=1000), nullable=True)) | ||
|
||
with op.batch_alter_table('property_contacts_history', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('contact_type', contacttype, autoincrement=False, nullable=True)) | ||
batch_op.add_column(sa.Column('business_legal_name', sa.String(length=1000), autoincrement=False, nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('property_contacts_history', schema=None) as batch_op: | ||
batch_op.drop_column('business_legal_name') | ||
batch_op.drop_column('contact_type') | ||
|
||
with op.batch_alter_table('property_contacts', schema=None) as batch_op: | ||
batch_op.drop_column('business_legal_name') | ||
batch_op.drop_column('contact_type') | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "strr-api" | ||
version = "0.0.18" | ||
version = "0.0.19" | ||
description = "" | ||
authors = ["thorwolpert <[email protected]>"] | ||
license = "BSD 3-Clause" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"registration": { | ||
"registrationType": "HOST", | ||
"primaryContact": { | ||
"contactType": "BUSINESS", | ||
"businessLegalName": "Test Business", | ||
"businessNumber": "123456789", | ||
"name": { | ||
"firstName": "The", | ||
"middleName": "First", | ||
"lastName": "Guy" | ||
}, | ||
"dateOfBirth": "1986-10-23", | ||
"details": { | ||
"preferredName": "Mickey", | ||
"phoneNumber": "604-999-9999", | ||
"extension": "x64", | ||
"faxNumber": "604-777-7777", | ||
"emailAddress": "[email protected]" | ||
}, | ||
"mailingAddress": { | ||
"country": "CA", | ||
"address": "12766 227st", | ||
"addressLineTwo": "", | ||
"city": "MAPLE RIDGE", | ||
"province": "BC", | ||
"postalCode": "V2X 6K6" | ||
} | ||
}, | ||
"secondaryContact": { | ||
"contactType": "INDIVIDUAL", | ||
"name": { | ||
"firstName": "The", | ||
"middleName": "Other", | ||
"lastName": "Guy" | ||
}, | ||
"dateOfBirth": "1986-10-23", | ||
"details": { | ||
"preferredName": "Mouse", | ||
"phoneNumber": "604-888-8888", | ||
"extension": "", | ||
"faxNumber": "", | ||
"emailAddress": "[email protected]" | ||
}, | ||
"mailingAddress": { | ||
"country": "CA", | ||
"address": "12766 227st", | ||
"addressLineTwo": "", | ||
"city": "MAPLE RIDGE", | ||
"province": "BC", | ||
"postalCode": "V2X 6K6" | ||
} | ||
}, | ||
"unitDetails": { | ||
"parcelIdentifier": "000-460-991", | ||
"businessLicense": "7777777", | ||
"businessLicenseExpiryDate": "2025-01-01", | ||
"propertyType": "SINGLE_FAMILY_HOME", | ||
"ownershipType": "OWN", | ||
"rentalUnitSpaceType": "ENTIRE_HOME", | ||
"hostResidence": "SAME_UNIT", | ||
"isUnitOnPrincipalResidenceProperty": true, | ||
"numberOfRoomsForRent": 1 | ||
}, | ||
"unitAddress": { | ||
"nickname": "My Rental Property", | ||
"country": "CA", | ||
"address": "12166 GREENWELL ST MAPLE RIDGE", | ||
"addressLineTwo": "", | ||
"city": "MAPLE RIDGE", | ||
"province": "BC", | ||
"postalCode": "V2X 7N1" | ||
}, | ||
"listingDetails": [ | ||
{ | ||
"url": "https://www.airbnb.ca/rooms/26359027" | ||
} | ||
], | ||
"principalResidence": { | ||
"isPrincipalResidence": true, | ||
"agreedToRentalAct": true, | ||
"nonPrincipalOption": "n/a", | ||
"specifiedServiceProvider": "n/a", | ||
"agreedToSubmit": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,66 @@ | |
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Host Registration - Business as a host", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"var jsonData = pm.response.json();", | ||
"", | ||
"pm.test(\"Status code is 201\", function () {", | ||
" pm.response.to.have.status(201);", | ||
"});", | ||
"", | ||
"pm.environment.set(\"application_number\",jsonData.header.applicationNumber)" | ||
], | ||
"type": "text/javascript", | ||
"packages": {} | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "bearer", | ||
"bearer": [ | ||
{ | ||
"key": "token", | ||
"value": "{{token}}", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Account-Id", | ||
"value": "{{account_id}}", | ||
"type": "text" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n \"registration\": {\n \"registrationType\": \"HOST\",\n \"primaryContact\": {\n \"contactType\": \"BUSINESS\",\n \"businessLegalName\": \"Test Business\",\n \"businessNumber\": \"123456789\",\n \"name\": {\n \"firstName\": \"The\",\n \"middleName\": \"First\",\n \"lastName\": \"Guy\"\n },\n \"dateOfBirth\": \"1986-10-23\",\n \"details\": {\n \"preferredName\": \"Mickey\",\n \"phoneNumber\": \"604-999-9999\",\n \"extension\": \"x64\",\n \"faxNumber\": \"604-777-7777\",\n \"emailAddress\": \"[email protected]\"\n },\n \"mailingAddress\": {\n \"country\": \"CA\",\n \"address\": \"12766 227st\",\n \"addressLineTwo\": \"\",\n \"city\": \"MAPLE RIDGE\",\n \"province\": \"BC\",\n \"postalCode\": \"V2X 6K6\"\n }\n },\n \"secondaryContact\": {\n \"contactType\": \"INDIVIDUAL\",\n \"name\": {\n \"firstName\": \"The\",\n \"middleName\": \"Other\",\n \"lastName\": \"Guy\"\n },\n \"dateOfBirth\": \"1986-10-23\",\n \"details\": {\n \"preferredName\": \"Mouse\",\n \"phoneNumber\": \"604-888-8888\",\n \"extension\": \"\",\n \"faxNumber\": \"\",\n \"emailAddress\": \"[email protected]\"\n },\n \"mailingAddress\": {\n \"country\": \"CA\",\n \"address\": \"12766 227st\",\n \"addressLineTwo\": \"\",\n \"city\": \"MAPLE RIDGE\",\n \"province\": \"BC\",\n \"postalCode\": \"V2X 6K6\"\n }\n },\n \"unitDetails\": {\n \"parcelIdentifier\": \"000-460-991\",\n \"businessLicense\": \"7777777\",\n \"businessLicenseExpiryDate\": \"2025-01-01\",\n \"propertyType\": \"SINGLE_FAMILY_HOME\",\n \"ownershipType\": \"OWN\",\n \"rentalUnitSpaceType\": \"ENTIRE_HOME\",\n \"hostResidence\": \"SAME_UNIT\",\n \"isUnitOnPrincipalResidenceProperty\": true,\n \"numberOfRoomsForRent\": 1\n },\n \"unitAddress\": {\n \"nickname\": \"My Rental Property\",\n \"country\": \"CA\",\n \"address\": \"12166 GREENWELL ST MAPLE RIDGE\",\n \"addressLineTwo\": \"\",\n \"city\": \"MAPLE RIDGE\",\n \"province\": \"BC\",\n \"postalCode\": \"V2X 7N1\"\n },\n \"listingDetails\": [\n {\n \"url\": \"https://www.airbnb.ca/rooms/26359027\"\n }\n ],\n \"principalResidence\": {\n \"isPrincipalResidence\": true,\n \"agreedToRentalAct\": true,\n \"nonPrincipalOption\": \"n/a\",\n \"specifiedServiceProvider\": \"n/a\",\n \"agreedToSubmit\": true\n }\n }\n}\n", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
} | ||
}, | ||
"url": { | ||
"raw": "{{api_url}}/applications", | ||
"host": [ | ||
"{{api_url}}" | ||
], | ||
"path": [ | ||
"applications" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Update Application Payment Details", | ||
"request": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters