From e1c43b2e64a443c33d68cb66e4eb34c080515215 Mon Sep 17 00:00:00 2001 From: deetz99 <73151365+deetz99@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:19:41 -0800 Subject: [PATCH] Examiner - UI: Host details expansion (#457) * add host utils, types and enums to base web * initial expansion * bump version * fix --- .../app/enums/document-upload-type.ts | 16 ++ strr-base-web/app/enums/host/index.ts | 9 + strr-base-web/app/enums/host/owner-role.ts | 5 + strr-base-web/app/enums/host/owner-type.ts | 4 + .../app/enums/host/ownership-type.ts | 6 + .../enums/host/pr-exemption-other-provider.ts | 8 + .../app/enums/host/pr-exemption-reason.ts | 5 + strr-base-web/app/enums/host/property-type.ts | 12 ++ .../app/enums/host/rental-unit-setup-types.ts | 5 + .../app/enums/host/rental-unit-type.ts | 4 + .../app/enums/host/residence-type.ts | 4 + strr-base-web/app/enums/index.ts | 1 + strr-base-web/app/interfaces/host/host-api.ts | 75 +++++++ .../app/interfaces/host/host-owner.ts | 11 ++ .../app/interfaces/host/host-property.ts | 9 + strr-base-web/app/interfaces/host/host-ui.ts | 23 +++ strr-base-web/app/interfaces/host/index.ts | 7 + .../host/principal-residence-requirements.ts | 4 + .../host/property-requirements-error.ts | 5 + .../interfaces/host/property-requirements.ts | 7 + strr-base-web/app/interfaces/index.ts | 1 + strr-base-web/app/utils/host/formatting.ts | 144 ++++++++++++++ strr-base-web/app/utils/host/index.ts | 1 + strr-base-web/app/utils/index.ts | 1 + .../app/components/DetailsExpansion/index.vue | 27 +++ .../app/components/HostDetails/Owners.vue | 171 ++++++++++++++++ .../app/components/HostDetailsView.vue | 184 ++++++++++-------- strr-examiner-web/app/interfaces/host-i.ts | 147 -------------- strr-examiner-web/app/layouts/examiner.vue | 4 +- strr-examiner-web/app/pages/dashboard.vue | 1 - .../app/pages/examine/[applicationId].vue | 23 ++- .../app/types/host-details-display-item.ts | 1 + strr-examiner-web/nuxt.config.ts | 6 - strr-examiner-web/package.json | 2 +- 34 files changed, 689 insertions(+), 244 deletions(-) create mode 100644 strr-base-web/app/enums/host/index.ts create mode 100644 strr-base-web/app/enums/host/owner-role.ts create mode 100644 strr-base-web/app/enums/host/owner-type.ts create mode 100644 strr-base-web/app/enums/host/ownership-type.ts create mode 100644 strr-base-web/app/enums/host/pr-exemption-other-provider.ts create mode 100644 strr-base-web/app/enums/host/pr-exemption-reason.ts create mode 100644 strr-base-web/app/enums/host/property-type.ts create mode 100644 strr-base-web/app/enums/host/rental-unit-setup-types.ts create mode 100644 strr-base-web/app/enums/host/rental-unit-type.ts create mode 100644 strr-base-web/app/enums/host/residence-type.ts create mode 100644 strr-base-web/app/enums/index.ts create mode 100644 strr-base-web/app/interfaces/host/host-api.ts create mode 100644 strr-base-web/app/interfaces/host/host-owner.ts create mode 100644 strr-base-web/app/interfaces/host/host-property.ts create mode 100644 strr-base-web/app/interfaces/host/host-ui.ts create mode 100644 strr-base-web/app/interfaces/host/index.ts create mode 100644 strr-base-web/app/interfaces/host/principal-residence-requirements.ts create mode 100644 strr-base-web/app/interfaces/host/property-requirements-error.ts create mode 100644 strr-base-web/app/interfaces/host/property-requirements.ts create mode 100644 strr-base-web/app/interfaces/index.ts create mode 100644 strr-base-web/app/utils/host/formatting.ts create mode 100644 strr-base-web/app/utils/host/index.ts create mode 100644 strr-examiner-web/app/components/DetailsExpansion/index.vue create mode 100644 strr-examiner-web/app/components/HostDetails/Owners.vue delete mode 100644 strr-examiner-web/app/interfaces/host-i.ts create mode 100644 strr-examiner-web/app/types/host-details-display-item.ts diff --git a/strr-base-web/app/enums/document-upload-type.ts b/strr-base-web/app/enums/document-upload-type.ts index e701fb68f..b21607e4a 100644 --- a/strr-base-web/app/enums/document-upload-type.ts +++ b/strr-base-web/app/enums/document-upload-type.ts @@ -1,3 +1,19 @@ export enum DocumentUploadType { + BC_DRIVERS_LICENSE = 'BC_DRIVERS_LICENSE', + BCSC = 'BCSC', + COMBINED_BCSC_LICENSE = 'COMBINED_BCSC_LICENSE', + PROPERTY_ASSESSMENT_NOTICE = 'PROPERTY_ASSESSMENT_NOTICE', + SPEC_TAX_CONFIRMATION = 'SPEC_TAX_CONFIRMATION', + HOG_DECLARATION = 'HOG_DECLARATION', + ICBC_CERTIFICATE_OF_INSURANCE = 'ICBC_CERTIFICATE_OF_INSURANCE', + HOME_INSURANCE_SUMMARY = 'HOME_INSURANCE_SUMMARY', + PROPERTY_TAX_NOTICE = 'PROPERTY_TAX_NOTICE', + UTILITY_BILL = 'UTILITY_BILL', + GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE = 'GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE', + FRACTIONAL_OWNERSHIP_AGREEMENT = 'FRACTIONAL_OWNERSHIP_AGREEMENT', + STRATA_HOTEL_DOCUMENTATION = 'STRATA_HOTEL_DOCUMENTATION', + TENANCY_AGREEMENT = 'TENANCY_AGREEMENT', + RENT_RECEIPT_OR_BANK_STATEMENT = 'RENT_RECEIPT_OR_BANK_STATEMENT', + LOCAL_GOVT_BUSINESS_LICENSE = 'LOCAL_GOVT_BUSINESS_LICENSE', OTHERS = 'OTHERS' } diff --git a/strr-base-web/app/enums/host/index.ts b/strr-base-web/app/enums/host/index.ts new file mode 100644 index 000000000..d0a80f7a6 --- /dev/null +++ b/strr-base-web/app/enums/host/index.ts @@ -0,0 +1,9 @@ +export * from './owner-role' +export * from './owner-type' +export * from './ownership-type' +export * from './pr-exemption-other-provider' +export * from './pr-exemption-reason' +export * from './property-type' +export * from './rental-unit-setup-types' +export * from './rental-unit-type' +export * from './residence-type' diff --git a/strr-base-web/app/enums/host/owner-role.ts b/strr-base-web/app/enums/host/owner-role.ts new file mode 100644 index 000000000..cc68b5eef --- /dev/null +++ b/strr-base-web/app/enums/host/owner-role.ts @@ -0,0 +1,5 @@ +export enum OwnerRole { + HOST = 'HOST', + CO_HOST = 'CO_HOST', + PROPERTY_MANAGER = 'PROPERTY_MANAGER' +} diff --git a/strr-base-web/app/enums/host/owner-type.ts b/strr-base-web/app/enums/host/owner-type.ts new file mode 100644 index 000000000..e46850c84 --- /dev/null +++ b/strr-base-web/app/enums/host/owner-type.ts @@ -0,0 +1,4 @@ +export enum OwnerType { + INDIVIDUAL = 'INDIVIDUAL', + BUSINESS = 'BUSINESS' +} diff --git a/strr-base-web/app/enums/host/ownership-type.ts b/strr-base-web/app/enums/host/ownership-type.ts new file mode 100644 index 000000000..6c1e151ec --- /dev/null +++ b/strr-base-web/app/enums/host/ownership-type.ts @@ -0,0 +1,6 @@ +export enum OwnershipType { + RENT = 'RENT', + OWN = 'OWN', + CO_OWN = 'CO_OWN', + OTHER = 'OTHER' +} diff --git a/strr-base-web/app/enums/host/pr-exemption-other-provider.ts b/strr-base-web/app/enums/host/pr-exemption-other-provider.ts new file mode 100644 index 000000000..065aed534 --- /dev/null +++ b/strr-base-web/app/enums/host/pr-exemption-other-provider.ts @@ -0,0 +1,8 @@ +export enum PrExemptionOtherProvider { + TIMESHARE = 'TIMESHARE', + FRACTIONAL_OWNERSHIP = 'FRACTIONAL_OWNERSHIP', + HOME_EXCHANGE = 'HOME_EXCHANGE', + LODGE_OPERATOR = 'LODGE_OPERATOR', + EDUCATIONAL_INSTITUTION = 'EDUCATIONAL_INSTITUTION', + STRATA_GUEST_SUITE = 'STRATA_GUEST_SUITE' +} diff --git a/strr-base-web/app/enums/host/pr-exemption-reason.ts b/strr-base-web/app/enums/host/pr-exemption-reason.ts new file mode 100644 index 000000000..566544b81 --- /dev/null +++ b/strr-base-web/app/enums/host/pr-exemption-reason.ts @@ -0,0 +1,5 @@ +export enum PrExemptionReason { + STRATA_HOTEL = 'STRATA_HOTEL', + FARM_LAND = 'FARM_LAND', + FRACTIONAL_OWNERSHIP = 'FRACTIONAL_OWNERSHIP', +} diff --git a/strr-base-web/app/enums/host/property-type.ts b/strr-base-web/app/enums/host/property-type.ts new file mode 100644 index 000000000..49a95e1d3 --- /dev/null +++ b/strr-base-web/app/enums/host/property-type.ts @@ -0,0 +1,12 @@ +export enum PropertyType { + SECONDARY_SUITE = 'SECONDARY_SUITE', + ACCESSORY_DWELLING = 'ACCESSORY_DWELLING', + TOWN_HOME = 'TOWN_HOME', + MULTI_UNIT_HOUSING = 'MULTI_UNIT_HOUSING', + CONDO_OR_APT = 'CONDO_OR_APT', + STRATA_HOTEL = 'STRATA_HOTEL', + SINGLE_FAMILY_HOME = 'SINGLE_FAMILY_HOME', + RECREATIONAL = 'RECREATIONAL', + BED_AND_BREAKFAST = 'BED_AND_BREAKFAST', + FLOAT_HOME = 'FLOAT_HOME' +} diff --git a/strr-base-web/app/enums/host/rental-unit-setup-types.ts b/strr-base-web/app/enums/host/rental-unit-setup-types.ts new file mode 100644 index 000000000..cc108b963 --- /dev/null +++ b/strr-base-web/app/enums/host/rental-unit-setup-types.ts @@ -0,0 +1,5 @@ +export enum RentalUnitSetupType { + WHOLE_PRINCIPAL_RESIDENCE = 'WHOLE_PRINCIPAL_RESIDENCE', // The whole Host Principal Residence + UNIT_ON_PR_PROPERTY = 'UNIT_ON_PR_PROPERTY', // A whole unit on the same property as the Host Principal Residence (e.g., basement suite) + UNIT_NOT_ON_PR_PROPERTY = 'UNIT_NOT_ON_PR_PROPERTY' // Not on the same property as the Host Principal Residence +} diff --git a/strr-base-web/app/enums/host/rental-unit-type.ts b/strr-base-web/app/enums/host/rental-unit-type.ts new file mode 100644 index 000000000..6b182c487 --- /dev/null +++ b/strr-base-web/app/enums/host/rental-unit-type.ts @@ -0,0 +1,4 @@ +export enum RentalUnitType { + ENTIRE_HOME = 'ENTIRE_HOME', + SHARED_ACCOMMODATION = 'SHARED_ACCOMMODATION' +} diff --git a/strr-base-web/app/enums/host/residence-type.ts b/strr-base-web/app/enums/host/residence-type.ts new file mode 100644 index 000000000..787dbe0c1 --- /dev/null +++ b/strr-base-web/app/enums/host/residence-type.ts @@ -0,0 +1,4 @@ +export enum ResidenceType { + SAME_UNIT = 'SAME_UNIT', + ANOTHER_UNIT = 'ANOTHER_UNIT' +} diff --git a/strr-base-web/app/enums/index.ts b/strr-base-web/app/enums/index.ts new file mode 100644 index 000000000..5722a3c9f --- /dev/null +++ b/strr-base-web/app/enums/index.ts @@ -0,0 +1 @@ +export * from './host' diff --git a/strr-base-web/app/interfaces/host/host-api.ts b/strr-base-web/app/interfaces/host/host-api.ts new file mode 100644 index 000000000..42ea5f3c5 --- /dev/null +++ b/strr-base-web/app/interfaces/host/host-api.ts @@ -0,0 +1,75 @@ +export interface ApiPartyWithAddress extends ApiParty { + mailingAddress: ApiAddress +} + +export interface ApiHostContactPerson extends ApiPartyWithAddress { + contactType: OwnerType + dateOfBirth?: string + socialInsuranceNumber?: string + businessLegalName?: string + businessNumber?: string +} + +export interface ApiHostContactBusiness extends ApiHostContactPerson { + businessLegalName: string + businessNumber: string +} + +export interface ApiPropertyManagerBusiness { + legalName: string + businessNumber?: string + mailingAddress: ApiAddress + primaryContact: ApiParty + secondaryContact?: ApiParty +} + +export interface ApiPropertyManager { + initiatedByPropertyManager: boolean + propertyManagerType: OwnerType + business?: ApiPropertyManagerBusiness // required if OwnerType.BUSINESS + contact?: ApiPartyWithAddress // required if OwnerType.INDIVIDUAL +} + +export interface ApiUnitDetails { + parcelIdentifier?: string + businessLicense?: string + businessLicenseExpiryDate?: string + propertyType: PropertyType | undefined + ownershipType: OwnershipType | undefined + rentalUnitSpaceType: RentalUnitType | undefined + hostResidence: ResidenceType | undefined + isUnitOnPrincipalResidenceProperty: boolean | undefined + numberOfRoomsForRent: number | undefined + prExemptReason?: PrExemptionReason +} + +export interface ApiUnitAddress extends ApiBaseAddress { + nickname: string + streetName: string, + streetNumber: string, + unitNumber: string +} + +export interface ApiHostApplication { + registrationType: ApplicationType + primaryContact: ApiHostContactPerson | ApiHostContactBusiness + secondaryContact?: ApiHostContactPerson | ApiHostContactBusiness + unitDetails: ApiUnitDetails + unitAddress: ApiUnitAddress + propertyManager?: ApiPropertyManager, + strRequirements?: PropertyRequirements + documents: ApiDocument[] + listingDetails: string[] +} + +export interface HostApplicationPayload { + // Draft applications will not have all fields defined yet + registration: Partial +} + +export interface HostApplicationResp extends HostApplicationPayload { + header: ApplicationHeader +} + +export interface HostRegistrationResp extends ApiHostApplication, ApiExtraRegistrationDetails { +} diff --git a/strr-base-web/app/interfaces/host/host-owner.ts b/strr-base-web/app/interfaces/host/host-owner.ts new file mode 100644 index 000000000..06063c8e6 --- /dev/null +++ b/strr-base-web/app/interfaces/host/host-owner.ts @@ -0,0 +1,11 @@ +export interface HostOwner extends Contact { + ownerType: OwnerType + preferredName?: string + mailingAddress: ConnectAddress + businessLegalName: string + businessNumber: string + dateOfBirth: string + role: OwnerRole | undefined, + isCompParty: boolean + taxNumber: string +} diff --git a/strr-base-web/app/interfaces/host/host-property.ts b/strr-base-web/app/interfaces/host/host-property.ts new file mode 100644 index 000000000..3566d08b0 --- /dev/null +++ b/strr-base-web/app/interfaces/host/host-property.ts @@ -0,0 +1,9 @@ +export interface HostPropertyAddress extends ConnectAddress { + nickname: string + unitNumber: string +} + +export interface HostProperty extends ApiUnitDetails { + address: HostPropertyAddress + listingDetails: { url: string }[] +} diff --git a/strr-base-web/app/interfaces/host/host-ui.ts b/strr-base-web/app/interfaces/host/host-ui.ts new file mode 100644 index 000000000..ada567cbe --- /dev/null +++ b/strr-base-web/app/interfaces/host/host-ui.ts @@ -0,0 +1,23 @@ +// export interface HostPropertyAddress extends ConnectAddress { +// nickname: string +// unitNumber: string +// } + +export interface UiBlInfo { + businessLicense: string + businessLicenseExpiryDate: string +} + +export interface UiUnitDetails { + parcelIdentifier?: string + propertyType: PropertyType | undefined + ownershipType: OwnershipType | undefined + numberOfRoomsForRent: number | undefined + rentalUnitSetupType: RentalUnitSetupType | undefined + typeOfSpace: RentalUnitType | undefined +} + +export interface UiHostProperty extends UiUnitDetails { + address: HostPropertyAddress + listingDetails: { url: string }[] +} diff --git a/strr-base-web/app/interfaces/host/index.ts b/strr-base-web/app/interfaces/host/index.ts new file mode 100644 index 000000000..70cbfaba7 --- /dev/null +++ b/strr-base-web/app/interfaces/host/index.ts @@ -0,0 +1,7 @@ +export * from './host-api' +export * from './host-owner' +export * from './host-property' +export * from './host-ui' +export * from './principal-residence-requirements' +export * from './property-requirements' +export * from './property-requirements-error' diff --git a/strr-base-web/app/interfaces/host/principal-residence-requirements.ts b/strr-base-web/app/interfaces/host/principal-residence-requirements.ts new file mode 100644 index 000000000..93bff8d99 --- /dev/null +++ b/strr-base-web/app/interfaces/host/principal-residence-requirements.ts @@ -0,0 +1,4 @@ +export interface PrRequirements { + isPropertyPrExempt: boolean + prExemptionReason: PrExemptionReason | undefined +} diff --git a/strr-base-web/app/interfaces/host/property-requirements-error.ts b/strr-base-web/app/interfaces/host/property-requirements-error.ts new file mode 100644 index 000000000..67277dc66 --- /dev/null +++ b/strr-base-web/app/interfaces/host/property-requirements-error.ts @@ -0,0 +1,5 @@ +import type { FetchError } from 'ofetch' +export interface PropertyRequirementsError { + error?: FetchError + type: 'fetch' | 'unknown' // TODO: handle other error types +} diff --git a/strr-base-web/app/interfaces/host/property-requirements.ts b/strr-base-web/app/interfaces/host/property-requirements.ts new file mode 100644 index 000000000..5b55adfd5 --- /dev/null +++ b/strr-base-web/app/interfaces/host/property-requirements.ts @@ -0,0 +1,7 @@ +export interface PropertyRequirements { + isBusinessLicenceRequired: boolean + isPrincipalResidenceRequired: boolean + isStrProhibited: boolean + isStraaExempt: boolean | null + organizationNm: string +} diff --git a/strr-base-web/app/interfaces/index.ts b/strr-base-web/app/interfaces/index.ts new file mode 100644 index 000000000..5722a3c9f --- /dev/null +++ b/strr-base-web/app/interfaces/index.ts @@ -0,0 +1 @@ +export * from './host' diff --git a/strr-base-web/app/utils/host/formatting.ts b/strr-base-web/app/utils/host/formatting.ts new file mode 100644 index 000000000..b9224f28c --- /dev/null +++ b/strr-base-web/app/utils/host/formatting.ts @@ -0,0 +1,144 @@ +export function formatOwnerHostAPI (owner: HostOwner): ApiHostContactPerson | ApiHostContactBusiness { + return { + ...formatParty(owner), + contactType: owner.ownerType, + mailingAddress: formatAddress(owner.mailingAddress), + ...(owner.dateOfBirth ? { dateOfBirth: owner.dateOfBirth } : {}), + ...(owner.taxNumber ? { socialInsuranceNumber: owner.taxNumber } : {}), + ...(owner.businessLegalName ? { businessLegalName: owner.businessLegalName } : {}), + ...(owner.businessNumber ? { businessNumber: owner.businessNumber } : {}) + } +} + +export function formatOwnerHostUI ( + owner: ApiHostContactPerson | ApiHostContactBusiness, + isCompParty: boolean, + isCoHost?: boolean +): HostOwner { + return { + ...formatPartyUI(owner), + ownerType: owner.contactType, + dateOfBirth: owner.dateOfBirth || '', + taxNumber: owner.socialInsuranceNumber || '', + mailingAddress: formatAddressUI(owner.mailingAddress), + businessLegalName: owner.businessLegalName || '', + businessNumber: owner.businessNumber || '', + role: isCoHost ? OwnerRole.CO_HOST : OwnerRole.HOST, + isCompParty + } +} + +export function formatOwnerPropertyManagerAPI (owner: HostOwner): ApiPropertyManager { + return { + initiatedByPropertyManager: owner.isCompParty, + propertyManagerType: owner.ownerType, + ...(owner.ownerType === OwnerType.INDIVIDUAL + ? { + contact: { + ...formatParty(owner), + mailingAddress: formatAddress(owner.mailingAddress) + } + } + : { + business: { + legalName: owner.businessLegalName, + ...(owner.businessNumber ? { businessNumber: owner.businessNumber } : {}), + mailingAddress: formatAddress(owner.mailingAddress), + primaryContact: { ...formatParty(owner) } + } + } + ) + } +} + +export function formatOwnerPropertyManagerUI (owner: ApiPropertyManager): HostOwner { + return { + ownerType: owner.propertyManagerType, + ...formatPartyUI((owner.contact || owner.business?.primaryContact) as ApiParty), + mailingAddress: formatAddressUI((owner.contact?.mailingAddress || owner.business?.mailingAddress) as ApiAddress), + businessLegalName: owner.business?.legalName || '', + businessNumber: owner.business?.businessNumber || '', + dateOfBirth: '', + taxNumber: '', + role: OwnerRole.PROPERTY_MANAGER, + isCompParty: owner.initiatedByPropertyManager + } +} + +export function formatHostUnitDetailsAPI ( + unitDetails: UiUnitDetails, + blInfo: UiBlInfo, + prReqs: PrRequirements +): ApiUnitDetails { + return { + propertyType: unitDetails.propertyType, + ownershipType: unitDetails.ownershipType, + numberOfRoomsForRent: unitDetails.numberOfRoomsForRent, + isUnitOnPrincipalResidenceProperty: unitDetails.rentalUnitSetupType === undefined + ? undefined + : unitDetails.rentalUnitSetupType !== RentalUnitSetupType.UNIT_NOT_ON_PR_PROPERTY, + hostResidence: unitDetails.rentalUnitSetupType === undefined + ? undefined + : unitDetails.rentalUnitSetupType === RentalUnitSetupType.WHOLE_PRINCIPAL_RESIDENCE + ? ResidenceType.SAME_UNIT + : ResidenceType.ANOTHER_UNIT, + rentalUnitSpaceType: unitDetails.typeOfSpace, + ...(unitDetails.parcelIdentifier ? { parcelIdentifier: unitDetails.parcelIdentifier } : {}), + ...(blInfo.businessLicense ? { businessLicense: blInfo.businessLicense } : {}), + ...(blInfo.businessLicenseExpiryDate ? { businessLicenseExpiryDate: blInfo.businessLicenseExpiryDate } : {}), + ...(prReqs.isPropertyPrExempt && prReqs.prExemptionReason ? { prExemptReason: prReqs.prExemptionReason } : {}) + } +} + +export function formatHostUnitDetailsUI (unitDetails: ApiUnitDetails): UiUnitDetails { + const rentalSetupType = unitDetails.isUnitOnPrincipalResidenceProperty === undefined + ? undefined + : unitDetails.isUnitOnPrincipalResidenceProperty + ? unitDetails.hostResidence === ResidenceType.SAME_UNIT + ? RentalUnitSetupType.WHOLE_PRINCIPAL_RESIDENCE + : RentalUnitSetupType.UNIT_ON_PR_PROPERTY + : RentalUnitSetupType.UNIT_NOT_ON_PR_PROPERTY + return { + propertyType: unitDetails.propertyType, + ownershipType: unitDetails.ownershipType, + numberOfRoomsForRent: unitDetails.numberOfRoomsForRent, + rentalUnitSetupType: rentalSetupType, + typeOfSpace: unitDetails.rentalUnitSpaceType, + ...(unitDetails.parcelIdentifier ? { parcelIdentifier: unitDetails.parcelIdentifier } : {}) + } +} + +export function formatHostUnitDetailsBlInfoUI (unitDetails: ApiUnitDetails): UiBlInfo { + return { + businessLicense: unitDetails.businessLicense || '', + businessLicenseExpiryDate: unitDetails.businessLicenseExpiryDate || '' + } +} + +export function formatHostUnitAddressApi (unitAddress: HostPropertyAddress): ApiUnitAddress { + const baseAddress = formatAddress(unitAddress) + delete baseAddress.address // including this passes API validation, but causes a failure in the registration creation + return { + ...baseAddress, + nickname: unitAddress.nickname || '', + streetName: unitAddress.streetName || '', + streetNumber: unitAddress.streetNumber || '', + unitNumber: unitAddress.unitNumber || '' + } +} + +export function formatHostUnitAddressUI (unitAddress: ApiUnitAddress): HostPropertyAddress { + const baseAddress = formatAddressUI(unitAddress) + const street = baseAddress.street + ? baseAddress.street + : `${unitAddress.unitNumber ? unitAddress.unitNumber + '-' : ''}` + + `${unitAddress.streetNumber || ''} ${unitAddress.streetName}`.trim() + return { + ...baseAddress, + nickname: unitAddress.nickname || '', + streetName: unitAddress.streetName || '', + streetNumber: unitAddress.streetNumber || '', + unitNumber: unitAddress.unitNumber || '', + street + } +} diff --git a/strr-base-web/app/utils/host/index.ts b/strr-base-web/app/utils/host/index.ts new file mode 100644 index 000000000..99297511d --- /dev/null +++ b/strr-base-web/app/utils/host/index.ts @@ -0,0 +1 @@ +export * from './formatting' diff --git a/strr-base-web/app/utils/index.ts b/strr-base-web/app/utils/index.ts index e207b773f..ecbcc06ca 100644 --- a/strr-base-web/app/utils/index.ts +++ b/strr-base-web/app/utils/index.ts @@ -1 +1,2 @@ export * from './connect-validation' +export * from './host' diff --git a/strr-examiner-web/app/components/DetailsExpansion/index.vue b/strr-examiner-web/app/components/DetailsExpansion/index.vue new file mode 100644 index 000000000..02d22737c --- /dev/null +++ b/strr-examiner-web/app/components/DetailsExpansion/index.vue @@ -0,0 +1,27 @@ + + diff --git a/strr-examiner-web/app/components/HostDetails/Owners.vue b/strr-examiner-web/app/components/HostDetails/Owners.vue new file mode 100644 index 000000000..20ed333d9 --- /dev/null +++ b/strr-examiner-web/app/components/HostDetails/Owners.vue @@ -0,0 +1,171 @@ + + diff --git a/strr-examiner-web/app/components/HostDetailsView.vue b/strr-examiner-web/app/components/HostDetailsView.vue index 0846e3442..4c58547f3 100644 --- a/strr-examiner-web/app/components/HostDetailsView.vue +++ b/strr-examiner-web/app/components/HostDetailsView.vue @@ -1,6 +1,8 @@ - - - diff --git a/strr-examiner-web/app/interfaces/host-i.ts b/strr-examiner-web/app/interfaces/host-i.ts deleted file mode 100644 index 58729370e..000000000 --- a/strr-examiner-web/app/interfaces/host-i.ts +++ /dev/null @@ -1,147 +0,0 @@ -export enum OwnerType { - INDIVIDUAL = 'INDIVIDUAL', - BUSINESS = 'BUSINESS' -} - -export enum PropertyType { - SECONDARY_SUITE = 'SECONDARY_SUITE', - ACCESSORY_DWELLING = 'ACCESSORY_DWELLING', - TOWN_HOME = 'TOWN_HOME', - MULTI_UNIT_HOUSING = 'MULTI_UNIT_HOUSING', - CONDO_OR_APT = 'CONDO_OR_APT', - STRATA_HOTEL = 'STRATA_HOTEL', - SINGLE_FAMILY_HOME = 'SINGLE_FAMILY_HOME', - RECREATIONAL = 'RECREATIONAL', - BED_AND_BREAKFAST = 'BED_AND_BREAKFAST', - FLOAT_HOME = 'FLOAT_HOME' -} - -export enum OwnershipType { - RENT = 'RENT', - OWN = 'OWN', - CO_OWN = 'CO_OWN', - OTHER = 'OTHER' -} - -export enum RentalUnitType { - ENTIRE_HOME = 'ENTIRE_HOME', - SHARED_ACCOMMODATION = 'SHARED_ACCOMMODATION' -} - -export enum ResidenceType { - SAME_UNIT = 'SAME_UNIT', - ANOTHER_UNIT = 'ANOTHER_UNIT' -} - -export enum PrExemptionReason { - STRATA_HOTEL = 'STRATA_HOTEL', - FARM_LAND = 'FARM_LAND', - FRACTIONAL_OWNERSHIP = 'FRACTIONAL_OWNERSHIP' -} - -export interface ApiHostContactPerson extends ApiPartyWithAddress { - contactType: OwnerType - dateOfBirth?: string - socialInsuranceNumber?: string - businessLegalName?: string - businessNumber?: string -} - -export interface ApiHostContactBusiness extends ApiHostContactPerson { - businessLegalName: string - businessNumber: string -} - -export interface ApiUnitDetails { - parcelIdentifier?: string - businessLicense?: string - businessLicenseExpiryDate?: string - propertyType: PropertyType | undefined - ownershipType: OwnershipType | undefined - rentalUnitSpaceType: RentalUnitType | undefined - hostResidence: ResidenceType | undefined - isUnitOnPrincipalResidenceProperty: boolean | undefined - numberOfRoomsForRent: number | undefined - prExemptReason?: PrExemptionReason -} - -export interface ApiUnitAddress extends ApiBaseAddress { - nickname: string - streetName: string - streetNumber: string - unitNumber: string -} - -export interface ApiPropertyManagerBusiness { - legalName: string - businessNumber?: string - mailingAddress: ApiAddress - primaryContact: ApiParty - secondaryContact?: ApiParty -} - -export interface ApiPartyWithAddress extends ApiParty { - mailingAddress: ApiAddress -} - -export interface ApiPropertyManager { - initiatedByPropertyManager: boolean - propertyManagerType: OwnerType - business?: ApiPropertyManagerBusiness // required if OwnerType.BUSINESS - contact?: ApiPartyWithAddress // required if OwnerType.INDIVIDUAL -} - -export interface PropertyRequirements { - isBusinessLicenceRequired: boolean - isPrincipalResidenceRequired: boolean - isStrProhibited: boolean - isStraaExempt: boolean | null - organizationNm: string -} - -export enum DocumentUploadType { - BC_DRIVERS_LICENSE = 'BC_DRIVERS_LICENSE', - BCSC = 'BCSC', - COMBINED_BCSC_LICENSE = 'COMBINED_BCSC_LICENSE', - PROPERTY_ASSESSMENT_NOTICE = 'PROPERTY_ASSESSMENT_NOTICE', - SPEC_TAX_CONFIRMATION = 'SPEC_TAX_CONFIRMATION', - HOG_DECLARATION = 'HOG_DECLARATION', - ICBC_CERTIFICATE_OF_INSURANCE = 'ICBC_CERTIFICATE_OF_INSURANCE', - HOME_INSURANCE_SUMMARY = 'HOME_INSURANCE_SUMMARY', - PROPERTY_TAX_NOTICE = 'PROPERTY_TAX_NOTICE', - UTILITY_BILL = 'UTILITY_BILL', - GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE = 'GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE', - FRACTIONAL_OWNERSHIP_AGREEMENT = 'FRACTIONAL_OWNERSHIP_AGREEMENT', - STRATA_HOTEL_DOCUMENTATION = 'STRATA_HOTEL_DOCUMENTATION', - TENANCY_AGREEMENT = 'TENANCY_AGREEMENT', - RENT_RECEIPT_OR_BANK_STATEMENT = 'RENT_RECEIPT_OR_BANK_STATEMENT', - LOCAL_GOVT_BUSINESS_LICENSE = 'LOCAL_GOVT_BUSINESS_LICENSE', - OTHERS = 'OTHERS' -} - -export interface ApiDocument { - documentType: DocumentUploadType - fileKey: string - fileName: string - fileType: string -} - -export interface ApiHostApplication { - registrationType: ApplicationType - primaryContact: ApiHostContactPerson | ApiHostContactBusiness - secondaryContact?: ApiHostContactPerson | ApiHostContactBusiness - unitDetails: ApiUnitDetails - unitAddress: ApiUnitAddress - propertyManager?: ApiPropertyManager - strRequirements?: PropertyRequirements - documents: ApiDocument[] - listingDetails: string[] -} - -export interface HostApplicationPayload { - registration: ApiHostApplication -} - -export interface HostApplicationResp extends HostApplicationPayload { - header: ApplicationHeader -} diff --git a/strr-examiner-web/app/layouts/examiner.vue b/strr-examiner-web/app/layouts/examiner.vue index bf0fa8003..4a8febfa0 100644 --- a/strr-examiner-web/app/layouts/examiner.vue +++ b/strr-examiner-web/app/layouts/examiner.vue @@ -1,5 +1,4 @@