diff --git a/.github/workflows/strr-ui-cd.yaml b/.github/workflows/strr-ui-cd.yaml index f14d30c6e..93add1404 100644 --- a/.github/workflows/strr-ui-cd.yaml +++ b/.github/workflows/strr-ui-cd.yaml @@ -4,8 +4,10 @@ on: push: branches: - main + - feature* paths: - "strr-web/**" + - "strr-examiner-web/**" workflow_dispatch: inputs: target: diff --git a/.github/workflows/strr-ui-ci.yaml b/.github/workflows/strr-ui-ci.yaml index 6bcbf8819..8db6cfb4b 100644 --- a/.github/workflows/strr-ui-ci.yaml +++ b/.github/workflows/strr-ui-ci.yaml @@ -4,6 +4,7 @@ on: pull_request: paths: - "strr-web/**" + - "strr-examiner-web/**" workflow_dispatch: defaults: diff --git a/strr-api/migrations/versions/20240703_412aa6608c42_.py b/strr-api/migrations/versions/20240703_412aa6608c42_.py index 38de888c9..1b7e9b79b 100644 --- a/strr-api/migrations/versions/20240703_412aa6608c42_.py +++ b/strr-api/migrations/versions/20240703_412aa6608c42_.py @@ -20,21 +20,8 @@ def upgrade(): - connection = op.get_bind() - # create tables - sql_script_path = os.path.join(sql_script_dir, 'gis_ddl.sql') - with open(sql_script_path, 'r') as file: - ddl_script = file.read() - - connection.execute(text(ddl_script)) - - # seed - sql_script_path = os.path.join(sql_script_dir, 'gis_seed.sql') - with open(sql_script_path, 'r') as file: - seed_script = file.read() - - connection.execute(text(seed_script)) + pass def downgrade(): - op.drop_table('dss_organization') + pass diff --git a/strr-api/migrations/versions/20240727_0656_d8b1f2dab56e_.py b/strr-api/migrations/versions/20240727_0656_d8b1f2dab56e_.py index 7ca37335a..acda76c53 100644 --- a/strr-api/migrations/versions/20240727_0656_d8b1f2dab56e_.py +++ b/strr-api/migrations/versions/20240727_0656_d8b1f2dab56e_.py @@ -56,15 +56,6 @@ def downgrade(): sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='event_records_user_id_fkey'), sa.PrimaryKeyConstraint('id', name='event_records_pkey') ) - op.create_table('spatial_ref_sys', - sa.Column('srid', sa.INTEGER(), autoincrement=False, nullable=False), - sa.Column('auth_name', sa.VARCHAR(length=256), autoincrement=False, nullable=True), - sa.Column('auth_srid', sa.INTEGER(), autoincrement=False, nullable=True), - sa.Column('srtext', sa.VARCHAR(length=2048), autoincrement=False, nullable=True), - sa.Column('proj4text', sa.VARCHAR(length=2048), autoincrement=False, nullable=True), - sa.CheckConstraint('srid > 0 AND srid <= 998999', name='spatial_ref_sys_srid_check'), - sa.PrimaryKeyConstraint('srid', name='spatial_ref_sys_pkey') - ) with op.batch_alter_table('events', schema=None) as batch_op: batch_op.drop_index(batch_op.f('ix_events_registration_id')) batch_op.drop_index(batch_op.f('ix_events_event_type')) diff --git a/strr-api/migrations/versions/20241212_0611_0fb49e0b4707_.py b/strr-api/migrations/versions/20241212_0611_0fb49e0b4707_.py new file mode 100644 index 000000000..3065c3515 --- /dev/null +++ b/strr-api/migrations/versions/20241212_0611_0fb49e0b4707_.py @@ -0,0 +1,46 @@ +"""empty message + +Revision ID: 0fb49e0b4707 +Revises: 8912b6965de6 +Create Date: 2024-12-12 06:11:20.394557 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '0fb49e0b4707' +down_revision = '8912b6965de6' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('contacts', schema=None) as batch_op: + batch_op.alter_column('firstname', + existing_type=sa.VARCHAR(), + nullable=True) + + with op.batch_alter_table('contacts_history', schema=None) as batch_op: + batch_op.alter_column('firstname', + existing_type=sa.VARCHAR(length=1000), + nullable=True, + autoincrement=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('contacts_history', schema=None) as batch_op: + batch_op.alter_column('firstname', + existing_type=sa.VARCHAR(length=1000), + nullable=False, + autoincrement=False) + + with op.batch_alter_table('contacts', schema=None) as batch_op: + batch_op.alter_column('firstname', + existing_type=sa.VARCHAR(), + nullable=False) + # ### end Alembic commands ### diff --git a/strr-api/migrations/versions/20241213_2034_55b9517ed210_.py b/strr-api/migrations/versions/20241213_2034_55b9517ed210_.py new file mode 100644 index 000000000..84edd3a8d --- /dev/null +++ b/strr-api/migrations/versions/20241213_2034_55b9517ed210_.py @@ -0,0 +1,42 @@ +"""empty message + +Revision ID: 55b9517ed210 +Revises: 0fb49e0b4707 +Create Date: 2024-12-13 20:34:29.306635 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '55b9517ed210' +down_revision = '0fb49e0b4707' +branch_labels = None +depends_on = None + +old_options = ('BC_DRIVERS_LICENSE', 'PROPERTY_ASSESSMENT_NOTICE', 'SPEC_TAX_CONFIRMATION', 'HOG_DECLARATION', 'ICBC_CERTIFICATE_OF_INSURANCE', 'HOME_INSURANCE_SUMMARY', 'PROPERTY_TAX_NOTICE', 'UTILITY_BILL', 'GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE', 'TENANCY_AGREEMENT', 'RENT_RECEIPT_OR_BANK_STATEMENT', 'LOCAL_GOVT_BUSINESS_LICENSE', 'OTHERS', 'STRATA_HOTEL_DOCUMENTATION', 'FRACTIONAL_OWNERSHIP_AGREEMENT', 'BCSC', 'COMBINED_BCSC_LICENCE') +new_options = ('BC_DRIVERS_LICENSE', 'PROPERTY_ASSESSMENT_NOTICE', 'SPEC_TAX_CONFIRMATION', 'HOG_DECLARATION', 'ICBC_CERTIFICATE_OF_INSURANCE', 'HOME_INSURANCE_SUMMARY', 'PROPERTY_TAX_NOTICE', 'UTILITY_BILL', 'GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE', 'TENANCY_AGREEMENT', 'RENT_RECEIPT_OR_BANK_STATEMENT', 'LOCAL_GOVT_BUSINESS_LICENSE', 'OTHERS', 'STRATA_HOTEL_DOCUMENTATION', 'FRACTIONAL_OWNERSHIP_AGREEMENT', 'BCSC', 'COMBINED_BCSC_LICENSE') + +old_type = sa.Enum(*old_options, name='documenttype') +new_type = sa.Enum(*new_options, name='documenttype') + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.execute('ALTER TYPE documenttype RENAME TO tmp_documenttype') + new_type.create(op.get_bind()) + op.execute('ALTER TABLE documents ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') + op.execute('ALTER TABLE documents_history ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') + op.execute('DROP TYPE tmp_documenttype') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.execute('ALTER TYPE documenttype RENAME TO tmp_documenttype') + old_type.create(op.get_bind()) + op.execute('ALTER TABLE documents ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') + op.execute('ALTER TABLE documents_history ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') + op.execute('DROP TYPE tmp_documenttype') + # ### end Alembic commands ### diff --git a/strr-api/pyproject.toml b/strr-api/pyproject.toml index e6b754f23..833ba021c 100644 --- a/strr-api/pyproject.toml +++ b/strr-api/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "strr-api" -version = "0.0.25" +version = "0.0.28" description = "" authors = ["thorwolpert "] license = "BSD 3-Clause" diff --git a/strr-api/src/strr_api/__init__.py b/strr-api/src/strr_api/__init__.py index 09233ee3f..6bc50782e 100644 --- a/strr-api/src/strr_api/__init__.py +++ b/strr-api/src/strr_api/__init__.py @@ -31,11 +31,10 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -"""The Legal API service. +"""The STRR API. -This module is the API for the Legal Entity system. +This module is the API for the Short Term Rental Registry. """ -import logging import logging.config import os @@ -43,7 +42,7 @@ import sentry_sdk from flask import Flask from flask_cors import CORS -from flask_migrate import Migrate, upgrade +from flask_migrate import Migrate from sentry_sdk.integrations.flask import FlaskIntegration from .common.auth import jwt @@ -79,9 +78,6 @@ def create_app(environment: Config = Production, **kwargs) -> Flask: if not app.config.get("TESTING", False): Migrate(app, db) - logger.info("Running migration upgrade.") - with app.app_context(): - upgrade(directory="migrations", revision="head", sql=False, tag=None) strr_pay.init_app(app) babel.init_app(app) diff --git a/strr-api/src/strr_api/models/__init__.py b/strr-api/src/strr_api/models/__init__.py index c21532feb..670d0e8ae 100644 --- a/strr-api/src/strr_api/models/__init__.py +++ b/strr-api/src/strr_api/models/__init__.py @@ -38,7 +38,6 @@ from .auto_approval_record import AutoApprovalRecord from .certificate import Certificate from .db import db # noqa: I001 -from .dss import DSSOrganization from .events import Events from .ltsa import LTSARecord from .platforms import Platform, PlatformBrand, PlatformRegistration, PlatformRepresentative @@ -61,7 +60,6 @@ "Contact", "Document", "Events", - "DSSOrganization", "AutoApprovalRecord", "LTSARecord", "Certificate", diff --git a/strr-api/src/strr_api/models/rental.py b/strr-api/src/strr_api/models/rental.py index b733cc3fd..29b39a615 100644 --- a/strr-api/src/strr_api/models/rental.py +++ b/strr-api/src/strr_api/models/rental.py @@ -194,7 +194,7 @@ class DocumentType(BaseEnum): STRATA_HOTEL_DOCUMENTATION = auto() # pylint: disable=invalid-name FRACTIONAL_OWNERSHIP_AGREEMENT = auto() # pylint: disable=invalid-name BCSC = auto() # pylint: disable=invalid-name - COMBINED_BCSC_LICENCE = auto() # pylint: disable=invalid-name + COMBINED_BCSC_LICENSE = auto() # pylint: disable=invalid-name __tablename__ = "documents" diff --git a/strr-api/src/strr_api/models/user.py b/strr-api/src/strr_api/models/user.py index f707e5057..99149166f 100644 --- a/strr-api/src/strr_api/models/user.py +++ b/strr-api/src/strr_api/models/user.py @@ -55,7 +55,7 @@ class Contact(Versioned, db.Model): __tablename__ = "contacts" id = db.Column(db.Integer, primary_key=True, autoincrement=True) - firstname = db.Column(db.String(1000), nullable=False) + firstname = db.Column(db.String(1000), nullable=True) lastname = db.Column(db.String(1000), nullable=False) middlename = db.Column(db.String(1000)) address_id = db.Column(db.Integer, db.ForeignKey("addresses.id"), nullable=True) diff --git a/strr-api/src/strr_api/requests/RegistrationRequest.py b/strr-api/src/strr_api/requests/RegistrationRequest.py index 8d10ef787..2404a6f51 100644 --- a/strr-api/src/strr_api/requests/RegistrationRequest.py +++ b/strr-api/src/strr_api/requests/RegistrationRequest.py @@ -1,6 +1,7 @@ # pylint: disable=C0103 # pylint: disable=R0913 # pylint: disable=R0917 +# pylint: disable=R0914 """ Registration request payload objects. """ @@ -22,21 +23,21 @@ def __init__( # pylint: disable=W0102 unitAddress, unitDetails, listingDetails, - principalResidence, secondaryContact=None, documents=[], # pylint: disable=W0102 registrationType=None, propertyManager=None, + strRequirements=None, ): self.primaryContact = Contact(**primaryContact) self.secondaryContact = Contact(**secondaryContact) if secondaryContact else None self.unitAddress = UnitAddress(**unitAddress) self.unitDetails = UnitDetails(**unitDetails) self.listingDetails = [ListingDetails(**item) for item in listingDetails] - self.principalResidence = PrincipalResidence(**principalResidence) self.documents = [Document(**document) for document in documents] self.registrationType = registrationType self.propertyManager = PropertyManager(**propertyManager) if propertyManager else None + self.strRequirements = strRequirements class PropertyManager: @@ -99,24 +100,6 @@ def __init__( self.mailingAddress = MailingAddress(**mailingAddress) if mailingAddress else None -class PrincipalResidence: - """PrincipalResidence payload object.""" - - def __init__( - self, - isPrincipalResidence, - agreedToRentalAct, - agreedToSubmit, - nonPrincipalOption=None, - specifiedServiceProvider=None, - ): - self.isPrincipalResidence = isPrincipalResidence - self.agreedToRentalAct = agreedToRentalAct - self.agreedToSubmit = agreedToSubmit - self.nonPrincipalOption = nonPrincipalOption - self.specifiedServiceProvider = specifiedServiceProvider - - class ListingDetails: """ListingDetails payload object.""" @@ -139,6 +122,7 @@ def __init__( businessLicense=None, businessLicenseExpiryDate=None, strataHotelRegistrationNumber=None, + prExemptReason=None, ): self.propertyType = propertyType self.ownershipType = ownershipType @@ -150,6 +134,7 @@ def __init__( self.numberOfRoomsForRent = numberOfRoomsForRent self.businessLicenseExpiryDate = businessLicenseExpiryDate self.strataHotelRegistrationNumber = strataHotelRegistrationNumber + self.prExemptReason = prExemptReason class MailingAddress: @@ -190,51 +175,42 @@ def __init__( self.unitNumber = unitNumber -class ContactName: - """ContactName payload object.""" - - def __init__(self, firstName, lastName, middleName=None): - self.firstName = firstName - self.lastName = lastName - self.middleName = middleName - - -class ContactDetails: - """ContactDetails payload object.""" - - def __init__( - self, phoneNumber, emailAddress, preferredName=None, extension=None, faxNumber=None, phoneCountryCode=None - ): - self.phoneNumber = phoneNumber - self.emailAddress = emailAddress - self.preferredName = preferredName - self.extension = extension - self.faxNumber = faxNumber - self.phoneCountryCode = phoneCountryCode - - class Contact: """Contact payload object.""" def __init__( self, - name, - details, - mailingAddress, + firstName=None, + lastName=None, + middleName=None, + mailingAddress=None, socialInsuranceNumber=None, businessNumber=None, businessLegalName=None, contactType=None, dateOfBirth=None, + phoneNumber=None, + emailAddress=None, + preferredName=None, + extension=None, + faxNumber=None, + phoneCountryCode=None, ): - self.name = ContactName(**name) + self.firstName = firstName + self.lastName = lastName + self.middleName = middleName self.dateOfBirth = dateOfBirth self.socialInsuranceNumber = socialInsuranceNumber self.businessNumber = businessNumber - self.details = ContactDetails(**details) - self.mailingAddress = MailingAddress(**mailingAddress) self.businessLegalName = businessLegalName self.contactType = contactType + self.phoneNumber = phoneNumber + self.emailAddress = emailAddress + self.preferredName = preferredName + self.extension = extension + self.faxNumber = faxNumber + self.phoneCountryCode = phoneCountryCode + self.mailingAddress = MailingAddress(**mailingAddress) class Document: diff --git a/strr-api/src/strr_api/responses/RegistrationSerializer.py b/strr-api/src/strr_api/responses/RegistrationSerializer.py index da340a4a0..23b8eaa5b 100644 --- a/strr-api/src/strr_api/responses/RegistrationSerializer.py +++ b/strr-api/src/strr_api/responses/RegistrationSerializer.py @@ -191,11 +191,9 @@ def populate_host_registration_details(cls, registration_data: dict, registratio secondary_property_contact = secondary_property_contacts[0] if secondary_property_contacts else None registration_data["primaryContact"] = { - "name": { - "firstName": primary_property_contact.contact.firstname, - "middleName": primary_property_contact.contact.middlename, - "lastName": primary_property_contact.contact.lastname, - }, + "firstName": primary_property_contact.contact.firstname, + "middleName": primary_property_contact.contact.middlename, + "lastName": primary_property_contact.contact.lastname, "dateOfBirth": primary_property_contact.contact.date_of_birth.strftime("%Y-%m-%d") if primary_property_contact.contact.date_of_birth else None, @@ -203,14 +201,12 @@ def populate_host_registration_details(cls, registration_data: dict, registratio "businessNumber": primary_property_contact.contact.business_number, "contactType": primary_property_contact.contact_type, "businessLegalName": primary_property_contact.business_legal_name, - "details": { - "preferredName": primary_property_contact.contact.preferredname, - "phoneNumber": primary_property_contact.contact.phone_number, - "phoneCountryCode": primary_property_contact.contact.phone_country_code, - "extension": primary_property_contact.contact.phone_extension, - "faxNumber": primary_property_contact.contact.fax_number, - "emailAddress": primary_property_contact.contact.email, - }, + "preferredName": primary_property_contact.contact.preferredname, + "phoneNumber": primary_property_contact.contact.phone_number, + "phoneCountryCode": primary_property_contact.contact.phone_country_code, + "extension": primary_property_contact.contact.phone_extension, + "faxNumber": primary_property_contact.contact.fax_number, + "emailAddress": primary_property_contact.contact.email, "mailingAddress": { "address": primary_property_contact.contact.address.street_address, "addressLineTwo": primary_property_contact.contact.address.street_address_additional, # noqa: E501 @@ -224,25 +220,21 @@ def populate_host_registration_details(cls, registration_data: dict, registratio registration_data["secondaryContact"] = None if secondary_property_contact: registration_data["secondaryContact"] = { - "name": { - "firstName": secondary_property_contact.contact.firstname, - "middleName": secondary_property_contact.contact.middlename, - "lastName": secondary_property_contact.contact.lastname, - }, + "firstName": secondary_property_contact.contact.firstname, + "middleName": secondary_property_contact.contact.middlename, + "lastName": secondary_property_contact.contact.lastname, "dateOfBirth": secondary_property_contact.contact.date_of_birth.strftime("%Y-%m-%d") if secondary_property_contact.contact.date_of_birth else None, "socialInsuranceNumber": secondary_property_contact.contact.social_insurance_number, "contactType": secondary_property_contact.contact_type, "businessNumber": secondary_property_contact.contact.business_number, - "details": { - "preferredName": secondary_property_contact.contact.preferredname, - "phoneNumber": secondary_property_contact.contact.phone_number, - "phoneCountryCode": secondary_property_contact.contact.phone_country_code, - "extension": secondary_property_contact.contact.phone_extension, - "faxNumber": secondary_property_contact.contact.fax_number, - "emailAddress": secondary_property_contact.contact.email, - }, + "preferredName": secondary_property_contact.contact.preferredname, + "phoneNumber": secondary_property_contact.contact.phone_number, + "phoneCountryCode": secondary_property_contact.contact.phone_country_code, + "extension": secondary_property_contact.contact.phone_extension, + "faxNumber": secondary_property_contact.contact.fax_number, + "emailAddress": secondary_property_contact.contact.email, "mailingAddress": { "address": secondary_property_contact.contact.address.street_address, "addressLineTwo": secondary_property_contact.contact.address.street_address_additional, @@ -281,19 +273,13 @@ def populate_host_registration_details(cls, registration_data: dict, registratio "isUnitOnPrincipalResidenceProperty": registration.rental_property.is_unit_on_principal_residence_property, "numberOfRoomsForRent": registration.rental_property.number_of_rooms_for_rent, "strataHotelRegistrationNumber": registration.rental_property.strata_hotel_registration_number, + "prExemptReason": registration.rental_property.pr_exempt_reason, } registration_data["listingDetails"] = [ {"url": platform.url} for platform in registration.rental_property.property_listings ] - registration_data["principalResidence"] = { - "isPrincipalResidence": registration.rental_property.is_principal_residence, - "agreedToRentalAct": registration.rental_property.rental_act_accepted, - "nonPrincipalOption": registration.rental_property.pr_exempt_reason, - "specifiedServiceProvider": registration.rental_property.service_provider, - } - if property_manager := registration.rental_property.property_manager: if property_manager.property_manager_type == PropertyManager.PropertyManagerType.BUSINESS: registration_data["propertyManager"] = { diff --git a/strr-api/src/strr_api/schemas/schemas/contact.json b/strr-api/src/strr_api/schemas/schemas/contact.json index f8c7a6cb5..56bc5841c 100644 --- a/strr-api/src/strr_api/schemas/schemas/contact.json +++ b/strr-api/src/strr_api/schemas/schemas/contact.json @@ -16,6 +16,28 @@ "preferredName": { "type": "string" }, + "dateOfBirth": { + "type": "string", + "format": "date", + "description": "YYYY-MM-DD" + }, + "socialInsuranceNumber": { + "type": "string" + }, + "businessNumber": { + "type": "string" + }, + "businessLegalName": { + "type": "string" + }, + "contactType": { + "type": "string", + "enum": [ + "INDIVIDUAL", + "BUSINESS" + ], + "default": "INDIVIDUAL" + }, "phoneNumber": { "type": "string" }, @@ -31,10 +53,12 @@ "emailAddress": { "type": "string", "format": "email" + }, + "mailingAddress": { + "$ref": "https://strr.gov.bc.ca/.well_known/schemas/address" } }, "required": [ - "firstName", "lastName", "phoneNumber", "emailAddress" diff --git a/strr-api/src/strr_api/schemas/schemas/host-registration.json b/strr-api/src/strr_api/schemas/schemas/host-registration.json index 76ef2874c..ba7dfed6e 100644 --- a/strr-api/src/strr_api/schemas/schemas/host-registration.json +++ b/strr-api/src/strr_api/schemas/schemas/host-registration.json @@ -4,90 +4,6 @@ "type": "object", "title": "Host Registration", "definitions": { - "contactName": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "middleName": { - "type": "string" - }, - "lastName": { - "type": "string" - } - }, - "required": [ - "firstName", - "lastName" - ] - }, - "contact": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/contactName" - }, - "dateOfBirth": { - "type": "string", - "format": "date", - "description": "YYYY-MM-DD" - }, - "socialInsuranceNumber": { - "type": "string" - }, - "businessNumber": { - "type": "string" - }, - "businessLegalName": { - "type": "string" - }, - "contactType": { - "type": "string", - "enum": [ - "INDIVIDUAL", - "BUSINESS" - ], - "default": "INDIVIDUAL" - }, - "details": { - "type": "object", - "properties": { - "preferredName": { - "type": "string" - }, - "phoneCountryCode": { - "type": "string" - }, - "phoneNumber": { - "type": "string" - }, - "extension": { - "type": "string" - }, - "faxNumber": { - "type": "string" - }, - "emailAddress": { - "type": "string", - "format": "email" - } - }, - "required": [ - "phoneNumber", - "emailAddress" - ] - }, - "mailingAddress": { - "$ref": "https://strr.gov.bc.ca/.well_known/schemas/address" - } - }, - "required": [ - "name", - "details", - "mailingAddress" - ] - }, "propertyManager": { "type": "object", "properties": { @@ -188,10 +104,10 @@ }, "properties": { "primaryContact": { - "$ref": "#/definitions/contact" + "$ref": "https://strr.gov.bc.ca/.well_known/schemas/contact" }, "secondaryContact": { - "$ref": "#/definitions/contact" + "$ref": "https://strr.gov.bc.ca/.well_known/schemas/contact" }, "unitAddress": { "$ref": "#/definitions/rentalUnitAddress" @@ -255,6 +171,14 @@ }, "strataHotelRegistrationNumber": { "type": "string" + }, + "prExemptReason": { + "type": "string", + "enum": [ + "STRATA_HOTEL", + "FARM_LAND", + "FRACTIONAL_OWNERSHIP" + ] } }, "required": [ @@ -278,31 +202,6 @@ } } }, - "principalResidence": { - "type": "object", - "properties": { - "isPrincipalResidence": { - "type": "boolean" - }, - "agreedToRentalAct": { - "type": "boolean" - }, - "nonPrincipalOption": { - "type": "string" - }, - "specifiedServiceProvider": { - "type": "string" - }, - "agreedToSubmit": { - "type": "boolean" - } - }, - "required": [ - "isPrincipalResidence", - "agreedToRentalAct", - "agreedToSubmit" - ] - }, "documents": { "type": "array", "items": { @@ -337,7 +236,7 @@ "STRATA_HOTEL_DOCUMENTATION", "FRACTIONAL_OWNERSHIP_AGREEMENT", "BCSC", - "COMBINED_BCSC_LICENCE" + "COMBINED_BCSC_LICENSE" ] } }, @@ -348,13 +247,32 @@ "documentType" ] } + }, + "strRequirements": { + "type": "object", + "properties": { + "isBusinessLicenceRequired": { + "type": ["boolean", "null"] + }, + "isPrincipalResidenceRequired": { + "type": ["boolean", "null"] + }, + "isStrProhibited": { + "type": ["boolean", "null"] + }, + "isStraaExempt": { + "type": ["boolean", "null"] + }, + "organizationNm": { + "type": ["string", "null"] + } + } } }, "required": [ "primaryContact", "unitAddress", "unitDetails", - "listingDetails", - "principalResidence" + "listingDetails" ] } diff --git a/strr-api/src/strr_api/schemas/schemas/platform-registration.json b/strr-api/src/strr_api/schemas/schemas/platform-registration.json index 26d78ba53..d2eb198e3 100644 --- a/strr-api/src/strr_api/schemas/schemas/platform-registration.json +++ b/strr-api/src/strr_api/schemas/schemas/platform-registration.json @@ -34,7 +34,6 @@ } }, "required": [ - "firstName", "lastName", "emailAddress" ] diff --git a/strr-api/src/strr_api/schemas/schemas/strata-hotel-registration.json b/strr-api/src/strr_api/schemas/schemas/strata-hotel-registration.json index a25908e61..6d76eee89 100644 --- a/strr-api/src/strr_api/schemas/schemas/strata-hotel-registration.json +++ b/strr-api/src/strr_api/schemas/schemas/strata-hotel-registration.json @@ -39,7 +39,6 @@ "required": [ "lastName", "emailAddress", - "jobTitle", "phoneNumber" ] }, diff --git a/strr-api/src/strr_api/services/approval_service.py b/strr-api/src/strr_api/services/approval_service.py index 96b6390e3..9ab4e4f28 100644 --- a/strr-api/src/strr_api/services/approval_service.py +++ b/strr-api/src/strr_api/services/approval_service.py @@ -120,10 +120,6 @@ def process_auto_approval(cls, application: Application) -> Tuple[Any, Any]: + registration.unitAddress.province ) auto_approval.renting = registration.unitDetails.ownershipType == RentalProperty.OwnershipType.RENT - auto_approval.serviceProvider = ( - registration.principalResidence.specifiedServiceProvider is not None - and registration.principalResidence.specifiedServiceProvider != "n/a" - ) organization = cls.getSTRDataForAddress(address) if organization: diff --git a/strr-api/src/strr_api/services/payment_service.py b/strr-api/src/strr_api/services/payment_service.py index b0555adb4..2637e4710 100644 --- a/strr-api/src/strr_api/services/payment_service.py +++ b/strr-api/src/strr_api/services/payment_service.py @@ -129,9 +129,6 @@ def _get_payment_request(self, application_json): payload = {"filingInfo": {"filingTypes": [filing_type_dict]}, "businessInfo": {"corpType": "STRR"}} - if registration_type == RegistrationType.HOST.value: - payload["paymentInfo"] = {"methodOfPayment": "DIRECT_PAY"} - if UserService.is_automation_tester(): payload["skipPayment"] = True diff --git a/strr-api/src/strr_api/services/registration_service.py b/strr-api/src/strr_api/services/registration_service.py index 8505d7a1d..93c39e246 100644 --- a/strr-api/src/strr_api/services/registration_service.py +++ b/strr-api/src/strr_api/services/registration_service.py @@ -293,10 +293,7 @@ def _create_host_registration(cls, registration_request: dict) -> RentalProperty number_of_rooms_for_rent=registration_request.unitDetails.numberOfRoomsForRent, property_type=registration_request.unitDetails.propertyType, ownership_type=registration_request.unitDetails.ownershipType, - is_principal_residence=registration_request.principalResidence.isPrincipalResidence, - rental_act_accepted=registration_request.principalResidence.agreedToRentalAct, - pr_exempt_reason=registration_request.principalResidence.nonPrincipalOption, - service_provider=registration_request.principalResidence.specifiedServiceProvider, + pr_exempt_reason=registration_request.unitDetails.prExemptReason, property_listings=[PropertyListing(url=listing.url) for listing in registration_request.listingDetails], strata_hotel_registration_number=registration_request.unitDetails.strataHotelRegistrationNumber, ) @@ -310,15 +307,15 @@ def _create_host_registration(cls, registration_request: dict) -> RentalProperty primary_property_contact.contact_type = registration_request.primaryContact.contactType primary_property_contact.business_legal_name = registration_request.primaryContact.businessLegalName primary_property_contact.contact = Contact( - firstname=registration_request.primaryContact.name.firstName, - lastname=registration_request.primaryContact.name.lastName, - middlename=registration_request.primaryContact.name.middleName, - email=registration_request.primaryContact.details.emailAddress, - preferredname=registration_request.primaryContact.details.preferredName, - phone_extension=registration_request.primaryContact.details.extension, - fax_number=registration_request.primaryContact.details.faxNumber, - phone_country_code=registration_request.primaryContact.details.phoneCountryCode, - phone_number=registration_request.primaryContact.details.phoneNumber, + firstname=registration_request.primaryContact.firstName, + lastname=registration_request.primaryContact.lastName, + middlename=registration_request.primaryContact.middleName, + email=registration_request.primaryContact.emailAddress, + preferredname=registration_request.primaryContact.preferredName, + phone_extension=registration_request.primaryContact.extension, + fax_number=registration_request.primaryContact.faxNumber, + phone_country_code=registration_request.primaryContact.phoneCountryCode, + phone_number=registration_request.primaryContact.phoneNumber, date_of_birth=registration_request.primaryContact.dateOfBirth, social_insurance_number=registration_request.primaryContact.socialInsuranceNumber, business_number=registration_request.primaryContact.businessNumber, @@ -338,15 +335,15 @@ def _create_host_registration(cls, registration_request: dict) -> RentalProperty secondary_property_contact.contact_type = registration_request.secondaryContact.contactType secondary_property_contact.business_legal_name = registration_request.secondaryContact.businessLegalName secondary_property_contact.contact = Contact( - firstname=registration_request.secondaryContact.name.firstName, - lastname=registration_request.secondaryContact.name.lastName, - middlename=registration_request.secondaryContact.name.middleName, - email=registration_request.secondaryContact.details.emailAddress, - preferredname=registration_request.secondaryContact.details.preferredName, - phone_extension=registration_request.secondaryContact.details.extension, - fax_number=registration_request.secondaryContact.details.faxNumber, - phone_country_code=registration_request.secondaryContact.details.phoneCountryCode, - phone_number=registration_request.secondaryContact.details.phoneNumber, + firstname=registration_request.secondaryContact.firstName, + lastname=registration_request.secondaryContact.lastName, + middlename=registration_request.secondaryContact.middleName, + email=registration_request.secondaryContact.emailAddress, + preferredname=registration_request.secondaryContact.preferredName, + phone_extension=registration_request.secondaryContact.extension, + fax_number=registration_request.secondaryContact.faxNumber, + phone_country_code=registration_request.secondaryContact.phoneCountryCode, + phone_number=registration_request.secondaryContact.phoneNumber, date_of_birth=registration_request.secondaryContact.dateOfBirth, social_insurance_number=registration_request.secondaryContact.socialInsuranceNumber, business_number=registration_request.secondaryContact.businessNumber, diff --git a/strr-api/tests/mocks/json/business_and_business_as_hosts.json b/strr-api/tests/mocks/json/business_and_business_as_hosts.json index 228b2f7bf..96d48b810 100644 --- a/strr-api/tests/mocks/json/business_and_business_as_hosts.json +++ b/strr-api/tests/mocks/json/business_and_business_as_hosts.json @@ -5,19 +5,15 @@ "contactType": "BUSINESS", "businessLegalName": "Test Business", "businessNumber": "123456789", - "name": { - "firstName": "The", - "middleName": "First", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "First", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mickey", - "phoneNumber": "604-999-9999", - "extension": "x64", - "faxNumber": "604-777-7777", - "emailAddress": "test@test.test" - }, + "preferredName": "Mickey", + "phoneNumber": "604-999-9999", + "extension": "x64", + "faxNumber": "604-777-7777", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -31,19 +27,15 @@ "contactType": "BUSINESS", "businessLegalName": "Test Business 2", "businessNumber": "555555555", - "name": { - "firstName": "The", - "middleName": "First", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "First", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mickey", - "phoneNumber": "604-999-9999", - "extension": "x64", - "faxNumber": "604-777-7777", - "emailAddress": "test@test.test" - }, + "preferredName": "Mickey", + "phoneNumber": "604-999-9999", + "extension": "x64", + "faxNumber": "604-777-7777", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12765 227st", @@ -79,13 +71,6 @@ { "url": "https://www.airbnb.ca/rooms/26359027" } - ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "nonPrincipalOption": "n/a", - "specifiedServiceProvider": "n/a", - "agreedToSubmit": true - } + ] } } diff --git a/strr-api/tests/mocks/json/business_and_individual_as_hosts.json b/strr-api/tests/mocks/json/business_and_individual_as_hosts.json index 2e39df5be..96c86e8cb 100644 --- a/strr-api/tests/mocks/json/business_and_individual_as_hosts.json +++ b/strr-api/tests/mocks/json/business_and_individual_as_hosts.json @@ -5,19 +5,15 @@ "contactType": "BUSINESS", "businessLegalName": "Test Business", "businessNumber": "123456789", - "name": { - "firstName": "The", - "middleName": "First", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "First", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mickey", - "phoneNumber": "604-999-9999", - "extension": "x64", - "faxNumber": "604-777-7777", - "emailAddress": "test@test.test" - }, + "preferredName": "Mickey", + "phoneNumber": "604-999-9999", + "extension": "x64", + "faxNumber": "604-777-7777", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -29,19 +25,15 @@ }, "secondaryContact": { "contactType": "INDIVIDUAL", - "name": { - "firstName": "The", - "middleName": "Other", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "Other", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mouse", - "phoneNumber": "604-888-8888", - "extension": "", - "faxNumber": "", - "emailAddress": "test2@test.test" - }, + "preferredName": "Mouse", + "phoneNumber": "604-888-8888", + "extension": "", + "faxNumber": "", + "emailAddress": "test2@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -77,13 +69,6 @@ { "url": "https://www.airbnb.ca/rooms/26359027" } - ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "nonPrincipalOption": "n/a", - "specifiedServiceProvider": "n/a", - "agreedToSubmit": true - } + ] } } diff --git a/strr-api/tests/mocks/json/host_registration.json b/strr-api/tests/mocks/json/host_registration.json index f7109e8ac..d36f1036f 100644 --- a/strr-api/tests/mocks/json/host_registration.json +++ b/strr-api/tests/mocks/json/host_registration.json @@ -2,20 +2,16 @@ "registration": { "registrationType": "HOST", "primaryContact": { - "name": { - "firstName": "The", - "middleName": "First", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "First", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mickey", - "phoneCountryCode": "001", - "phoneNumber": "604-999-9999", - "extension": "x64", - "faxNumber": "604-777-7777", - "emailAddress": "test@test.test" - }, + "preferredName": "Mickey", + "phoneCountryCode": "001", + "phoneNumber": "604-999-9999", + "extension": "x64", + "faxNumber": "604-777-7777", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -26,20 +22,16 @@ } }, "secondaryContact": { - "name": { - "firstName": "The", - "middleName": "Other", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "Other", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mouse", - "phoneCountryCode": "001", - "phoneNumber": "604-888-8888", - "extension": "", - "faxNumber": "", - "emailAddress": "test2@test.test" - }, + "preferredName": "Mouse", + "phoneCountryCode": "001", + "phoneNumber": "604-888-8888", + "extension": "", + "faxNumber": "", + "emailAddress": "test2@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -49,17 +41,6 @@ "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", @@ -71,18 +52,30 @@ "province": "BC", "postalCode": "V2X 7N1" }, + "strRequirements": { + "isBusinessLicenceRequired": false, + "isPrincipalResidenceRequired": true, + "isStrProhibited": false, + "isStraaExempt": null, + "organizationNm": "City of Maple Ridge" + }, + "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, + "prExemptReason": "FRACTIONAL_OWNERSHIP" + }, "listingDetails": [ { "url": "https://www.airbnb.ca/rooms/26359027" } ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "nonPrincipalOption": "n/a", - "specifiedServiceProvider": "n/a", - "agreedToSubmit": true - }, "documents": [ { "fileName": "Drivers License", @@ -93,3 +86,4 @@ ] } } + diff --git a/strr-api/tests/mocks/json/host_registration_ltsa.json b/strr-api/tests/mocks/json/host_registration_ltsa.json index dee70a1b8..de9e84470 100644 --- a/strr-api/tests/mocks/json/host_registration_ltsa.json +++ b/strr-api/tests/mocks/json/host_registration_ltsa.json @@ -2,16 +2,12 @@ "registration": { "registrationType": "HOST", "primaryContact": { - "name": { - "firstName": "Tyler", - "lastName": "Zale" - }, + "firstName": "Test", + "lastName": "User", "dateOfBirth": "1986-10-23", "socialInsuranceNumber": "666666666", - "details": { - "phoneNumber": "604-999-9999", - "emailAddress": "test@test.test" - }, + "phoneNumber": "604-999-9999", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 228st", @@ -40,11 +36,6 @@ "postalCode": "V2X 6N2" }, "listingDetails": [ - ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "agreedToSubmit": true - } + ] } } diff --git a/strr-api/tests/mocks/json/host_registration_minimum.json b/strr-api/tests/mocks/json/host_registration_minimum.json index ebd8127e7..4960250eb 100644 --- a/strr-api/tests/mocks/json/host_registration_minimum.json +++ b/strr-api/tests/mocks/json/host_registration_minimum.json @@ -2,17 +2,13 @@ "registration": { "registrationType": "HOST", "primaryContact": { - "name": { - "firstName": "The", - "lastName": "Guy" - }, + "firstName": "The", + "lastName": "Guy", "dateOfBirth": "1986-10-23", "socialInsuranceNumber": "666666666", "businessNumber": "123456789", - "details": { - "phoneNumber": "604-999-9999", - "emailAddress": "test@test.test" - }, + "phoneNumber": "604-999-9999", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -39,11 +35,6 @@ "postalCode": "V2X 7N1" }, "listingDetails": [ - ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "agreedToSubmit": true - } + ] } } diff --git a/strr-api/tests/mocks/json/property_manager_business.json b/strr-api/tests/mocks/json/property_manager_business.json index ecca4b2ce..71dda7fa8 100644 --- a/strr-api/tests/mocks/json/property_manager_business.json +++ b/strr-api/tests/mocks/json/property_manager_business.json @@ -2,20 +2,16 @@ "registration": { "registrationType": "HOST", "primaryContact": { - "name": { - "firstName": "The", - "middleName": "First", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "First", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mickey", - "phoneCountryCode": "001", - "phoneNumber": "604-999-9999", - "extension": "x64", - "faxNumber": "604-777-7777", - "emailAddress": "test@test.test" - }, + "preferredName": "Mickey", + "phoneCountryCode": "001", + "phoneNumber": "604-999-9999", + "extension": "x64", + "faxNumber": "604-777-7777", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -26,20 +22,16 @@ } }, "secondaryContact": { - "name": { - "firstName": "The", - "middleName": "Other", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "Other", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mouse", - "phoneCountryCode": "001", - "phoneNumber": "604-888-8888", - "extension": "", - "faxNumber": "", - "emailAddress": "test2@test.test" - }, + "preferredName": "Mouse", + "phoneCountryCode": "001", + "phoneNumber": "604-888-8888", + "extension": "", + "faxNumber": "", + "emailAddress": "test2@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -76,13 +68,6 @@ "url": "https://www.airbnb.ca/rooms/26359027" } ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "nonPrincipalOption": "n/a", - "specifiedServiceProvider": "n/a", - "agreedToSubmit": true - }, "propertyManager": { "initiatedByPropertyManager": false, "propertyManagerType": "BUSINESS", diff --git a/strr-api/tests/mocks/json/property_manager_individual.json b/strr-api/tests/mocks/json/property_manager_individual.json index f8b8649a6..47e327257 100644 --- a/strr-api/tests/mocks/json/property_manager_individual.json +++ b/strr-api/tests/mocks/json/property_manager_individual.json @@ -2,20 +2,14 @@ "registration": { "registrationType": "HOST", "primaryContact": { - "name": { - "firstName": "The", - "middleName": "First", - "lastName": "Guy" - }, + "lastName": "TestA", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mickey", - "phoneCountryCode": "001", - "phoneNumber": "604-999-9999", - "extension": "x64", - "faxNumber": "604-777-7777", - "emailAddress": "test@test.test" - }, + "preferredName": "Mickey", + "phoneCountryCode": "001", + "phoneNumber": "604-999-9999", + "extension": "x64", + "faxNumber": "604-777-7777", + "emailAddress": "test@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -26,20 +20,16 @@ } }, "secondaryContact": { - "name": { - "firstName": "The", - "middleName": "Other", - "lastName": "Guy" - }, + "firstName": "The", + "middleName": "Other", + "lastName": "Guy", "dateOfBirth": "1986-10-23", - "details": { - "preferredName": "Mouse", - "phoneCountryCode": "001", - "phoneNumber": "604-888-8888", - "extension": "", - "faxNumber": "", - "emailAddress": "test2@test.test" - }, + "preferredName": "Mouse", + "phoneCountryCode": "001", + "phoneNumber": "604-888-8888", + "extension": "", + "faxNumber": "", + "emailAddress": "test2@test.test", "mailingAddress": { "country": "CA", "address": "12766 227st", @@ -76,13 +66,6 @@ "url": "https://www.airbnb.ca/rooms/26359027" } ], - "principalResidence": { - "isPrincipalResidence": true, - "agreedToRentalAct": true, - "nonPrincipalOption": "n/a", - "specifiedServiceProvider": "n/a", - "agreedToSubmit": true - }, "propertyManager": { "initiatedByPropertyManager": false, "propertyManagerType": "INDIVIDUAL", diff --git a/strr-api/tests/postman/strr-api.postman_collection.json b/strr-api/tests/postman/strr-api.postman_collection.json index 7ce52b62e..bbfd4582b 100644 --- a/strr-api/tests/postman/strr-api.postman_collection.json +++ b/strr-api/tests/postman/strr-api.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "a0b2883b-75ca-4130-853f-dabb7d473484", + "_postman_id": "0c77eed1-d596-4cec-a54e-d7e2b5cdd8c6", "name": "strr-api", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "31792407" @@ -50,7 +50,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"registration\": {\n \"primaryContact\": {\n \"name\": {\n \"firstName\": \"Test\",\n \"middleName\": \"\",\n \"lastName\": \"Test\"\n },\n \"details\": {\n \"preferredName\": \"\",\n \"phoneNumber\": \"5554443322\",\n \"extension\": \"\",\n \"faxNumber\": \"\",\n \"emailAddress\": \"test@email.com\"\n },\n \"mailingAddress\": {\n \"address\": \"123 Main St\",\n \"city\": \"Victoria\",\n \"postalCode\": \"V3V2V2\",\n \"province\": \"BC\",\n \"country\": \"CA\"\n },\n \"businessNumber\": \"\",\n \"businessLegalName\": \"ABC Rentals\",\n \"contactType\": \"BUSINESS\"\n },\n \"unitAddress\": {\n \"unitNumber\": \"\",\n \"streetNumber\": \"3948\",\n \"streetName\": \"Helen Rd\",\n \"addressLineTwo\": \"\",\n \"city\": \"Victoria\",\n \"postalCode\": \"V3V2V2\",\n \"province\": \"BC\",\n \"country\": \"CA\",\n \"nickname\": \"\"\n },\n \"unitDetails\": {\n \"propertyType\": \"SECONDARY_SUITE\",\n \"ownershipType\": \"OWN\",\n \"rentalUnitSpaceType\": \"ENTIRE_HOME\",\n \"isUnitOnPrincipalResidenceProperty\": false,\n \"numberOfRoomsForRent\": 1\n },\n \"principalResidence\": {\n \"isPrincipalResidence\": false,\n \"agreedToRentalAct\": false,\n \"agreedToSubmit\": true,\n \"nonPrincipalOption\": \"Located in exempt community\",\n \"specifiedServiceProvider\": \"n/a\"\n },\n \"documents\": [\n {\n \"fileName\": \"Drivers License\",\n \"fileType\": \"pdf\",\n \"fileKey\": \"a1234\",\n \"documentType\": \"BC_DRIVERS_LICENSE\"\n },\n {\n \"fileName\": \"Property Assessment Notice\",\n \"fileType\": \"pdf\",\n \"fileKey\": \"b1234\",\n \"documentType\": \"PROPERTY_ASSESSMENT_NOTICE\"\n }\n ],\n \"registrationType\": \"HOST\",\n \"listingDetails\": []\n }\n}", + "raw": "{\n \"registration\": {\n \"registrationType\": \"HOST\",\n \"primaryContact\": {\n \"firstName\": \"The\",\n \"middleName\": \"First\",\n \"lastName\": \"Guy\",\n \"dateOfBirth\": \"1986-10-23\",\n \"preferredName\": \"Mickey\",\n \"phoneCountryCode\": \"001\",\n \"phoneNumber\": \"604-999-9999\",\n \"extension\": \"x64\",\n \"faxNumber\": \"604-777-7777\",\n \"emailAddress\": \"test@test.test\",\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 \"firstName\": \"The\",\n \"middleName\": \"Other\",\n \"lastName\": \"Guy\",\n \"dateOfBirth\": \"1986-10-23\",\n \"preferredName\": \"Mouse\",\n \"phoneCountryCode\": \"001\",\n \"phoneNumber\": \"604-888-8888\",\n \"extension\": \"\",\n \"faxNumber\": \"\",\n \"emailAddress\": \"test2@test.test\",\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 \"unitAddress\": {\n \"nickname\": \"My Rental Property\",\n \"country\": \"CA\",\n \"unitNumber\": \"\",\n \"streetNumber\": \"12166\",\n \"streetName\": \"GREENWELL ST MAPLE RIDGE\",\n \"addressLineTwo\": \"\",\n \"city\": \"MAPLE RIDGE\",\n \"province\": \"BC\",\n \"postalCode\": \"V2X 7N1\"\n },\n \"strRequirements\": {\n \"isBusinessLicenceRequired\": false,\n \"isPrincipalResidenceRequired\": true,\n \"isStrProhibited\": false,\n \"isStraaExempt\": null,\n \"organizationNm\": \"City of Maple Ridge\"\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 \"prExemptReason\": \"FRACTIONAL_OWNERSHIP\"\n },\n \"listingDetails\": [\n {\n \"url\": \"https://www.airbnb.ca/rooms/26359027\"\n }\n ],\n \"documents\": [\n {\n \"fileName\": \"Drivers License\",\n \"fileType\": \"pdf\",\n \"fileKey\": \"a1234\",\n \"documentType\": \"BC_DRIVERS_LICENSE\"\n }\n ]\n }\n}", "options": { "raw": { "language": "json" @@ -230,7 +230,7 @@ ], "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\": \"test@test.test\"\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\": \"test2@test.test\"\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 \"addressLineTwo\": \"\",\n \"city\": \"MAPLE RIDGE\",\n \"province\": \"BC\",\n \"postalCode\": \"V2X 7N1\",\n \"unitNumber\": \"\",\n \"streetNumber\": \"123\",\n \"streetName\": \"Main St\"\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}", + "raw": "{\n \"registration\": {\n \"registrationType\": \"HOST\",\n \"primaryContact\": {\n \"contactType\": \"BUSINESS\",\n \"businessLegalName\": \"Test Business\",\n \"businessNumber\": \"123456789\",\n \"firstName\": \"The\",\n \"middleName\": \"First\",\n \"lastName\": \"Guy\",\n \"dateOfBirth\": \"1986-10-23\",\n \"preferredName\": \"Mickey\",\n \"phoneNumber\": \"604-999-9999\",\n \"extension\": \"x64\",\n \"faxNumber\": \"604-777-7777\",\n \"emailAddress\": \"test@test.test\",\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 \"firstName\": \"The\",\n \"middleName\": \"Other\",\n \"lastName\": \"Guy\",\n \"dateOfBirth\": \"1986-10-23\",\n \"preferredName\": \"Mouse\",\n \"phoneNumber\": \"604-888-8888\",\n \"extension\": \"\",\n \"faxNumber\": \"\",\n \"emailAddress\": \"test2@test.test\",\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 \"unitNumber\": \"\",\n \"streetNumber\": \"12166\",\n \"streetName\": \"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 }\n}", "options": { "raw": { "language": "json" diff --git a/strr-api/tests/unit/schemas/test_schema.py b/strr-api/tests/unit/schemas/test_schema.py index 1854b5dfd..a9113e1ce 100644 --- a/strr-api/tests/unit/schemas/test_schema.py +++ b/strr-api/tests/unit/schemas/test_schema.py @@ -44,15 +44,6 @@ def test_validate_host_schema_error_missing_primary_contact(): assert error -def test_validate_host_schema_error_missing_principal_residence(): - with open(HOST_REGISTRATION_REQUEST) as f: - data = json.load(f) - del data["registration"]["principalResidence"] - valid, error = utils.validate_schema(data, f"{REGISTRATION_SCHEMA}") - assert not valid - assert error - - def test_validate_host_schema_error_missing_unit_address(): with open(HOST_REGISTRATION_REQUEST) as f: data = json.load(f) diff --git a/strr-base-web/.eslintrc b/strr-base-web/.eslintrc index 141577c5d..a54bcd0e9 100644 --- a/strr-base-web/.eslintrc +++ b/strr-base-web/.eslintrc @@ -23,7 +23,8 @@ "app-inner-container", "connect-date-picker", "connect-date-picker__err", - "prose-bcGov" + "prose-bcGov", + "max-w-bcGovInput" ] }], "no-use-before-define": "off" diff --git a/strr-base-web/app/app.config.ts b/strr-base-web/app/app.config.ts index 04c07f1d1..c3fef9d2d 100644 --- a/strr-base-web/app/app.config.ts +++ b/strr-base-web/app/app.config.ts @@ -6,7 +6,10 @@ export default defineAppConfig({ redirectPath: '', options: { createAccount: true, - idps: ['bcsc', 'bceid', 'idir'] + idps: ['bcsc', 'bceid', 'idir'], + bcscSubtext: undefined, + bceidSubtext: undefined, + idirSubtext: undefined } } } @@ -95,19 +98,3 @@ export default defineAppConfig({ } } }) - -declare module 'nuxt/schema' { - interface AppConfig { - strrBaseLayer: { - page: { - login: { - redirectPath: string, - options: { - createAccount: boolean, - idps: Array<'bcsc' | 'bceid' | 'idir'> - } - } - } - } - } -} diff --git a/strr-base-web/app/components/connect/Breadcrumb.vue b/strr-base-web/app/components/connect/Breadcrumb.vue deleted file mode 100644 index 39c3a3ddb..000000000 --- a/strr-base-web/app/components/connect/Breadcrumb.vue +++ /dev/null @@ -1,68 +0,0 @@ - - diff --git a/strr-base-web/app/components/connect/form/address/Index.vue b/strr-base-web/app/components/connect/form/address/Index.vue index 9d256d9e2..fa5ba298b 100644 --- a/strr-base-web/app/components/connect/form/address/Index.vue +++ b/strr-base-web/app/components/connect/form/address/Index.vue @@ -207,6 +207,7 @@ const addId = useId() :aria-invalid="error !== undefined" :aria-describedby="schemaPrefix + 'street-' + addId" :disabled="disabledFields?.includes('street')" + maxlength="1000" @keypress.once="addressComplete(id + '-street')" @click="addressComplete(id + '-street')" /> @@ -236,6 +237,7 @@ const addId = useId() :placeholder="$t('label.line2')" :aria-label="$t('label.line2')" :disabled="disabledFields?.includes('streetAdditional')" + maxlength="1000" />
@@ -288,6 +290,7 @@ const addId = useId() :aria-invalid="error !== undefined" :aria-describedby="schemaPrefix + 'region-' + addId" :disabled="disabledFields?.includes('region')" + maxlength="1000" /> @@ -329,6 +332,7 @@ const addId = useId() :disabled="disabledFields?.includes('locationDescription')" class="w-full" data-testid="address-location-description" + maxlength="1000" />
diff --git a/strr-base-web/app/components/connect/form/field/Group.vue b/strr-base-web/app/components/connect/form/field/Group.vue index d5ca6a76a..938792062 100644 --- a/strr-base-web/app/components/connect/form/field/Group.vue +++ b/strr-base-web/app/components/connect/form/field/Group.vue @@ -20,7 +20,8 @@ const props = defineProps({ size: { type: String, default: 'lg' }, ariaLabel: { type: String, default: undefined }, type: { type: String, default: 'text' }, - mask: { type: String, default: undefined } + mask: { type: String, default: undefined }, + maxlength: { type: Number, default: 1000 } }) const inputId = useId() @@ -46,6 +47,7 @@ const errorId = `${props.name}-error-${inputId}` :error-id="errorId" :aria-label="ariaLabel" size="lg" + :maxlength /> diff --git a/strr-base-web/app/components/connect/form/field/Index.vue b/strr-base-web/app/components/connect/form/field/Index.vue index ed59ba8e0..6b9e005a1 100644 --- a/strr-base-web/app/components/connect/form/field/Index.vue +++ b/strr-base-web/app/components/connect/form/field/Index.vue @@ -13,7 +13,8 @@ defineProps({ errorId: { type: String, default: undefined }, ariaLabel: { type: String, default: undefined }, type: { type: String, default: 'text' }, - mask: { type: String, default: undefined } + mask: { type: String, default: undefined }, + maxlength: { type: Number, default: 1000 } }) defineExpose({ model }) @@ -36,6 +37,7 @@ defineExpose({ model }) :aria-invalid="isInvalid" :aria-describedby="helpId" :aria-label="ariaLabel" + :maxlength /> diff --git a/strr-base-web/app/components/connect/form/phoneNumber/Index.vue b/strr-base-web/app/components/connect/form/phoneNumber/Index.vue index a87023333..9a38522a0 100644 --- a/strr-base-web/app/components/connect/form/phoneNumber/Index.vue +++ b/strr-base-web/app/components/connect/form/phoneNumber/Index.vue @@ -19,7 +19,7 @@ const phoneId = useId() defineExpose({ number })