diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 437ca2bb0..d5d1bcfa4 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.2.2", + "version": "3.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.2.2", + "version": "3.2.3", "dependencies": { "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 13bf14bb4..8bf4ea011 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.2.2", + "version": "3.2.3", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", @@ -14,7 +14,7 @@ "test:coverage": "vitest run --coverage" }, "dependencies": { - "@bcrs-shared-components/input-field-date-picker" : "^1.0.0", + "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", "@lemoncode/fonk-range-number-validator": "^1.1.0", "@sentry/vue": "^7.50.0", diff --git a/ppr-ui/src/components/common/RegistrationsWrapper.vue b/ppr-ui/src/components/common/RegistrationsWrapper.vue index 92a2e9595..ed5e8c204 100644 --- a/ppr-ui/src/components/common/RegistrationsWrapper.vue +++ b/ppr-ui/src/components/common/RegistrationsWrapper.vue @@ -281,7 +281,13 @@ import { } from '@/resources/dialogOptions' import { StatusCodes } from 'http-status-codes' import { cloneDeep } from 'lodash' -import { useExemptions, useMhrCorrections, useNavigation, useNewMhrRegistration } from '@/composables' +import { + useExemptions, + useMhrCorrections, + useNavigation, + useNewMhrRegistration, + useMhrReRegistration +} from '@/composables' export default defineComponent({ name: 'RegistrationsWrapper', @@ -342,6 +348,8 @@ export default defineComponent({ const { goToExemptions } = useExemptions() + const { initMhrReRegistration } = useMhrReRegistration() + const localState = reactive({ loading: false, myRegAdd: '', @@ -721,6 +729,9 @@ export default defineComponent({ case UnitNoteDocTypes.NON_RESIDENTIAL_EXEMPTION: openMhrExemption(mhrInfo, action) break + case UnitNoteDocTypes.RESCIND_EXEMPTION: + openMhrReRegistration(mhrInfo) + break default: localState.myRegAction = null localState.myRegActionDocId = '' @@ -778,6 +789,12 @@ export default defineComponent({ await goToExemptions(type) } + const openMhrReRegistration = async (mhrSummary: MhRegistrationSummaryIF): Promise => { + localState.loading = true + await initMhrReRegistration(mhrSummary) + await goToRoute(RouteNames.SUBMITTING_PARTY) + } + const removeMhrDraft = async (mhrNumber: string): Promise => { localState.myRegDataLoading = true await deleteMhrDraft(mhrNumber) diff --git a/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue b/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue index aa7b04685..a88dead45 100644 --- a/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue +++ b/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue @@ -130,6 +130,13 @@ :currentState="amendedBadgeLocationType.currentState" isCaseSensitive /> + + +

Civic Address

Manufacturer's Name

Year of Manufacture

Make

Model

Home Certification

CSA Standard

Date of Engineer's Report

Rebuilt Status

Other Information

{ @@ -374,7 +375,7 @@ export default defineComponent({ formatAsHtml, RouteNames, correctionState, - isMhrCorrection, + showUpdatedBadge, getMhrRegistrationOtherInfo, getMhrRegistrationHomeDescription, isMhrManufacturerRegistration, diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue b/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue index a0e5fd87b..476647125 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue @@ -16,7 +16,7 @@ :class="{ 'error-text': validate }" >Certification string|boolean> => customRules( @@ -143,7 +144,7 @@ export default defineComponent({ hasError, yearRef, manufactureYearRules, - isMhrCorrection, + showUpdatedBadge, correctionState, getMhrBaseline, getMhrRegistration, diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue b/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue index d32f19921..2fcd6b5f1 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue @@ -18,7 +18,7 @@ Manufacturer's Name Make Model string|boolean> => { return [ @@ -235,7 +236,7 @@ export default defineComponent({ maxLength, greaterThan, isMhrManufacturerRegistration, - isMhrCorrection, + showUpdatedBadge, correctionState, ...toRefs(localState) } diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue b/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue index 34e4f18f9..f1e4b6a12 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue @@ -16,7 +16,7 @@ :class="{'error-text': validate}" >Other import { defineComponent, reactive, ref, toRefs, watch } from 'vue' import { useStore } from '@/store/store' -import { useInputRules, useMhrCorrections, useMhrValidations } from '@/composables/' +import { useInputRules, useMhrCorrections, useMhrValidations, useUpdatedBadges } from '@/composables/' import { storeToRefs } from 'pinia' import { FormIF } from '@/interfaces' import { UpdatedBadge } from '@/components/common' @@ -70,7 +70,9 @@ export default defineComponent({ MhrSectVal, setValidation } = useMhrValidations(toRefs(getMhrRegistrationValidationModel.value)) - const { correctionState, isMhrCorrection } = useMhrCorrections() + const { correctionState } = useMhrCorrections() + const { showUpdatedBadge } = useUpdatedBadges() + const otherInformationForm = ref(null) as FormIF const localState = reactive({ @@ -93,7 +95,7 @@ export default defineComponent({ return { maxLength, correctionState, - isMhrCorrection, + showUpdatedBadge, ...toRefs(localState) } } diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue b/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue index 49aa0a5b2..8a2639276 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue @@ -21,7 +21,7 @@ Rebuilt Description import { defineComponent, reactive, ref, toRefs, watch } from 'vue' import { useStore } from '@/store/store' -import { useInputRules, useMhrCorrections, useMhrValidations } from '@/composables/' +import { useInputRules, useMhrCorrections, useMhrValidations, useUpdatedBadges } from '@/composables/' import { storeToRefs } from 'pinia' import { FormIF } from '@/interfaces' import { UpdatedBadge } from '@/components/common' @@ -72,7 +72,9 @@ export default defineComponent({ MhrSectVal, setValidation } = useMhrValidations(toRefs(getMhrRegistrationValidationModel.value)) - const { correctionState, isMhrCorrection } = useMhrCorrections() + const { correctionState } = useMhrCorrections() + const { showUpdatedBadge } = useUpdatedBadges() + const rebuiltStatus = ref(null) as FormIF const localState = reactive({ @@ -96,7 +98,7 @@ export default defineComponent({ maxLength, rebuiltStatus, correctionState, - isMhrCorrection, + showUpdatedBadge, ...toRefs(localState) } } }) diff --git a/ppr-ui/src/components/tables/common/TableRow.vue b/ppr-ui/src/components/tables/common/TableRow.vue index 71fa05b67..fbe774565 100644 --- a/ppr-ui/src/components/tables/common/TableRow.vue +++ b/ppr-ui/src/components/tables/common/TableRow.vue @@ -495,7 +495,7 @@ v-if="isRoleStaffReg && isExemptionEnabled && hasChildResExemption(item) && ![HomeLocationTypes.HOME_PARK, HomeLocationTypes.LOT].includes(item.locationType)" data-test-id="rescind-exemption-btn" - :disabled="true" + :disabled="!isExemptOrCancelled(item.statusType)" @click="openExemption(UnitNoteDocTypes.RESCIND_EXEMPTION, item)" > @@ -504,7 +504,7 @@ class="ml-0 icon-small" src="@/assets/svgs/ic_exemption2.svg" > - Re-Register Home + Re-Register Manufactured Home { + const openExemption = (docType: UnitNoteDocTypes, item: MhRegistrationSummaryIF): void => { emit('action', { - action: doctType, + action: docType, mhrInfo: item }) } @@ -997,6 +997,9 @@ export default defineComponent({ return item.registrationType === APIRegistrationTypes.REPAIRERS_LIEN } + const isExemptOrCancelled = (statusType: MhApiStatusTypes): boolean => + [MhApiStatusTypes.EXEMPT, MhApiStatusTypes.CANCELLED].includes(statusType) + const refresh = async (item: RegistrationSummaryIF): Promise => { // could be base reg or child reg if (item.registeringName) { @@ -1128,7 +1131,6 @@ export default defineComponent({ hasRequiredTransfer, multipleWordsToTitleCase, freezeScrolling, - MhApiStatusTypes, APIMhrDescriptionTypes, getFormattedDate, getRegistrationType, @@ -1147,6 +1149,7 @@ export default defineComponent({ isDraft, isExpired, isRepairersLien, + isExemptOrCancelled, isRenewalDisabled, isRepairersLienAmendDisabled, isRoleStaffReg, diff --git a/ppr-ui/src/components/tombstone/Tombstone.vue b/ppr-ui/src/components/tombstone/Tombstone.vue index a5f9d4da5..8ac25b445 100644 --- a/ppr-ui/src/components/tombstone/Tombstone.vue +++ b/ppr-ui/src/components/tombstone/Tombstone.vue @@ -17,6 +17,8 @@ import { useRoute } from 'vue-router' // local import { TombstoneDefault, TombstoneDynamic } from '@/components/tombstone' import { useMhrCorrections } from '@/composables' +import { useStore } from '@/store/store' +import { storeToRefs } from 'pinia' export default defineComponent({ name: 'Tombstone', @@ -33,13 +35,15 @@ export default defineComponent({ setup () { const route = useRoute() const { isMhrCorrection } = useMhrCorrections() + const { isMhrReRegistration } = storeToRefs(useStore()) const localState = reactive({ currentPath: computed((): string => { return route.path }), displayTombstoneDynamic: computed((): boolean => { - return isMhrCorrection.value || ['discharge', 'renew', 'amend', 'mhr-information', 'exemption'] - .some(path => localState.currentPath.includes(path)) + return isMhrCorrection.value || isMhrReRegistration.value || + ['discharge', 'renew', 'amend', 'mhr-information', 'exemption'] + .some(path => localState.currentPath.includes(path)) }), displayMhrInformation: computed((): boolean => { return ['mhr-information', 'exemption'].some(path => localState.currentPath.includes(path)) diff --git a/ppr-ui/src/components/tombstone/TombstoneDynamic.vue b/ppr-ui/src/components/tombstone/TombstoneDynamic.vue index 229176367..558dc5a05 100755 --- a/ppr-ui/src/components/tombstone/TombstoneDynamic.vue +++ b/ppr-ui/src/components/tombstone/TombstoneDynamic.vue @@ -9,7 +9,7 @@ style="padding-top: 0.375rem;" > @@ -35,7 +35,7 @@ @@ -215,7 +215,8 @@ export default defineComponent({ getRegistrationNumber, getRegistrationType, getMhrInformation, - getMhrOriginalTransportPermitRegStatus + getMhrOriginalTransportPermitRegStatus, + isMhrReRegistration } = storeToRefs(useStore()) const { isRouteName } = useNavigation() const { isFrozenMhr } = useMhrInformation() @@ -287,6 +288,7 @@ export default defineComponent({ isCancelChangeLocationActive, isAmendLocationActive, getMhrInformation, + isMhrReRegistration, ...toRefs(localState) } } diff --git a/ppr-ui/src/composables/fees/FeeSummary.vue b/ppr-ui/src/composables/fees/FeeSummary.vue index 432c86ebb..dd9948d9f 100644 --- a/ppr-ui/src/composables/fees/FeeSummary.vue +++ b/ppr-ui/src/composables/fees/FeeSummary.vue @@ -313,7 +313,8 @@ export default defineComponent({ FeeSummaryTypes.NON_RESIDENTIAL_EXEMPTION, FeeSummaryTypes.MHR_TRANSPORT_PERMIT, FeeSummaryTypes.MHR_TRANSPORT_PERMIT_CANCEL, FeeSummaryTypes.MHR_AMEND_TRANSPORT_PERMIT, FeeSummaryTypes.MHR_STAFF_CORRECTION, - FeeSummaryTypes.MHR_CLIENT_CORRECTION, FeeSummaryTypes.MHR_PUBLIC_AMENDMENT + FeeSummaryTypes.MHR_CLIENT_CORRECTION, FeeSummaryTypes.MHR_PUBLIC_AMENDMENT, + FeeSummaryTypes.MHR_RE_REGISTRATION ] .includes(localState.feeType) }), @@ -332,7 +333,8 @@ export default defineComponent({ return mapFeeTypeToDisplayName(props.additionalFees?.feeType) }), isMhrTransaction: computed((): boolean => { - return [FeeSummaryTypes.MHR_TRANSFER, FeeSummaryTypes.MHR_TRANSPORT_PERMIT].includes(localState.feeType) + return [FeeSummaryTypes.MHR_TRANSFER, FeeSummaryTypes.MHR_TRANSPORT_PERMIT] + .includes(localState.feeType) }), isMhrCorrection: computed((): boolean => { return [FeeSummaryTypes.MHR_STAFF_CORRECTION, FeeSummaryTypes.MHR_CLIENT_CORRECTION] diff --git a/ppr-ui/src/composables/fees/enums/feeSummaryTypes.ts b/ppr-ui/src/composables/fees/enums/feeSummaryTypes.ts index e257e5b3c..0757b0ceb 100644 --- a/ppr-ui/src/composables/fees/enums/feeSummaryTypes.ts +++ b/ppr-ui/src/composables/fees/enums/feeSummaryTypes.ts @@ -6,6 +6,7 @@ export enum FeeSummaryTypes { MHSEARCH = 'manufactured_home_search', MHR_COMBINED_SEARCH = 'combined_home_search', NEW_MHR = 'new_mhr', + MHR_RE_REGISTRATION = 'mhr_re_registration', MHR_STAFF_CORRECTION = 'mhr_staff_correction', MHR_CLIENT_CORRECTION = 'mhr_client_correction', MHR_PUBLIC_AMENDMENT = 'mhr_public_amendment', diff --git a/ppr-ui/src/composables/fees/factories/useFeeSummary.ts b/ppr-ui/src/composables/fees/factories/useFeeSummary.ts index 4c05f9034..c85edd485 100644 --- a/ppr-ui/src/composables/fees/factories/useFeeSummary.ts +++ b/ppr-ui/src/composables/fees/factories/useFeeSummary.ts @@ -94,7 +94,11 @@ export function getFeeSummary ( if (isStaff) return { ...defaultFeeSummaries[FeeSummaryDefaults.NO_FEE] } return { ...defaultFeeSummaries[FeeSummaryDefaults.SEARCH_7] } } - if ([FeeSummaryTypes.NEW_MHR, FeeSummaryTypes.RESIDENTIAL_EXEMPTION].includes(feeType)) { + if ([ + FeeSummaryTypes.NEW_MHR, + FeeSummaryTypes.MHR_RE_REGISTRATION, + FeeSummaryTypes.RESIDENTIAL_EXEMPTION].includes(feeType) + ) { return { ...defaultFeeSummaries[FeeSummaryDefaults.DEFAULT_50] } } if(feeType === FeeSummaryTypes.NON_RESIDENTIAL_EXEMPTION) { diff --git a/ppr-ui/src/composables/index.ts b/ppr-ui/src/composables/index.ts index c6bf432bd..a37ca400d 100644 --- a/ppr-ui/src/composables/index.ts +++ b/ppr-ui/src/composables/index.ts @@ -6,3 +6,4 @@ export * from './useTableFeatures' export * from './userAccess' export * from './exemption' export * from './common' +export * from './useUpdatedBadges' diff --git a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts index fbb52efb7..faae3178a 100644 --- a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts +++ b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts @@ -541,6 +541,7 @@ export const useMhrInformation = () => { initDraftMhrInformation, parseSubmittingPartyInfo, getLienInfo, + parseMhrPermitData, ...toRefs(localState) } } diff --git a/ppr-ui/src/composables/mhrRegistration/index.ts b/ppr-ui/src/composables/mhrRegistration/index.ts index 80cd62d4c..e6fbff0a0 100644 --- a/ppr-ui/src/composables/mhrRegistration/index.ts +++ b/ppr-ui/src/composables/mhrRegistration/index.ts @@ -2,3 +2,4 @@ export { useHomeOwners } from './useHomeOwners' export { useMhrValidations } from './useMhrValidations' export { useNewMhrRegistration } from './useNewMhrRegistration' export { useMhrCorrections } from './useMhrCorrections' +export { useMhrReRegistration } from './useMhrReRegistration' diff --git a/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts b/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts index ad737259d..2e676ce80 100755 --- a/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts +++ b/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts @@ -48,7 +48,6 @@ export const useMhrCorrections = () => { } = storeToRefs(useStore()) const { containsCurrentRoute, goToRoute } = useNavigation() - // const { initDraftOrCurrentMhr } = useNewMhrRegistration(true) /** Returns true for staff when the feature flag is enabled **/ const isMhrChangesEnabled: ComputedRef = computed((): boolean => { @@ -81,13 +80,13 @@ export const useMhrCorrections = () => { /** Returns true when the set registration type is a REGC_CLIENT and current route is a Registration Route **/ const isClientCorrection: ComputedRef = computed((): boolean => { - return isRegistrationRoute.value && + return isRegistrationRoute.value && getRegistrationType.value?.registrationTypeAPI === APIRegistrationTypes.MHR_CORRECTION_CLIENT }) /** Returns true when the set registration type is a PUBA and current route is a Registration Route **/ const isPublicAmendment: ComputedRef = computed((): boolean => { - return isRegistrationRoute.value && + return isRegistrationRoute.value && getRegistrationType.value?.registrationTypeAPI === APIRegistrationTypes.MHR_PUBLIC_AMENDMENT }) @@ -327,6 +326,7 @@ export const useMhrCorrections = () => { * @returns {AdminRegistrationIF} - The correction payload for the Admin Registration. */ const buildCorrectionPayload = (mhrState: NewMhrRegistrationApiIF): AdminRegistrationIF => { + const correctionsList = getCorrectionsList() return { attentionReference: mhrState.attentionReference || '', documentId: mhrState.documentId, @@ -335,10 +335,10 @@ export const useMhrCorrections = () => { draftNumber: mhrState.draftNumber }), submittingParty: mhrState.submittingParty, - ...(getCorrectionsList().includes('status') && { + ...(correctionsList.includes('status') && { status: getMhrStatusType.value }), - ...(getCorrectionsList().some(value => descriptionGroup.includes(value)) && { + ...(correctionsList.some(value => descriptionGroup.includes(value)) && { description: { ...mhrState.description, baseInformation: { @@ -347,7 +347,7 @@ export const useMhrCorrections = () => { } } }), - ...(getCorrectionsList().includes('ownerGroups') && { + ...(correctionsList.includes('ownerGroups') && { addOwnerGroups: mhrState.ownerGroups .filter(group => group.action !== ActionTypes.REMOVED) .map(group => ({ @@ -356,10 +356,10 @@ export const useMhrCorrections = () => { })), deleteOwnerGroups: getMhrBaseline.value.ownerGroups }), - ...(getCorrectionsList().some(value => locationGroup.includes(value)) && { + ...(correctionsList.some(value => locationGroup.includes(value)) && { location: { ...mhrState.location, taxCertificate: false } }), - ...(getCorrectionsList().includes('landDetails') && { + ...(correctionsList.includes('landDetails') && { ownLand: mhrState.ownLand }) } diff --git a/ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts b/ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts new file mode 100644 index 000000000..64753f42a --- /dev/null +++ b/ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts @@ -0,0 +1,56 @@ +import { HomeCertificationOptions } from '@/enums' +import { MhRegistrationSummaryIF } from '@/interfaces' +import { MhrReRegistrationType } from '@/resources' +import { useStore } from '@/store/store' +import { fetchMhRegistration } from '@/utils' +import { useNewMhrRegistration } from './useNewMhrRegistration' +import { cloneDeep } from 'lodash' +import { useMhrInformation } from '../mhrInformation' + +export const useMhrReRegistration = () => { + const { + setMhrBaseline, + setRegistrationType + } = useStore() + + const { setMhrNumber, setMhrStatusType } = useStore() + const { parseMhrPermitData } = useMhrInformation() + + const initMhrReRegistration = async (mhrSummary: MhRegistrationSummaryIF): Promise => { + setMhrNumber(mhrSummary.mhrNumber) + setRegistrationType(MhrReRegistrationType) + setMhrStatusType(mhrSummary.statusType) + + const { data } = await fetchMhRegistration(mhrSummary.mhrNumber) + + // Handle 'certificationOption' or 'noCertification' value mapping (because it's not returned in response) + const certificationOption = + (data?.description?.csaNumber && HomeCertificationOptions.CSA) || + (data?.description?.engineerName && HomeCertificationOptions.ENGINEER_INSPECTION) || + null + + // remove props that should not be pre-populated into Re-Registration + data.documentId = '' + data.ownerGroups = [] + + // parse Transport Permit data to correctly show Location of Home step + parseMhrPermitData(data) + + // Preserve MHR snapshot + await setMhrBaseline( + cloneDeep({ + ...data, + description: { + ...data.description, + certificationOption: certificationOption, + hasNoCertification: certificationOption === null + } + }) + ) + await useNewMhrRegistration().initDraftOrCurrentMhr(data, false) + } + + return { + initMhrReRegistration + } +} diff --git a/ppr-ui/src/composables/useUpdatedBadges.ts b/ppr-ui/src/composables/useUpdatedBadges.ts new file mode 100644 index 000000000..eae987085 --- /dev/null +++ b/ppr-ui/src/composables/useUpdatedBadges.ts @@ -0,0 +1,17 @@ +import { ComputedRef, computed } from 'vue' +import { useMhrCorrections } from './mhrRegistration' +import { useStore } from '@/store/store' +import { storeToRefs } from 'pinia' + +export const useUpdatedBadges = () => { + + const { isMhrReRegistration } = storeToRefs(useStore()) + const { isMhrCorrection } = useMhrCorrections() + + const showUpdatedBadge: ComputedRef = computed((): boolean => + isMhrCorrection.value || isMhrReRegistration.value) + + return { + showUpdatedBadge + } +} diff --git a/ppr-ui/src/enums/registrationTypes.ts b/ppr-ui/src/enums/registrationTypes.ts index 9eb1c18e0..d1339be37 100644 --- a/ppr-ui/src/enums/registrationTypes.ts +++ b/ppr-ui/src/enums/registrationTypes.ts @@ -57,6 +57,7 @@ export enum APIRegistrationTypes { MHR_CORRECTION_STAFF = 'REGC_STAFF', MHR_CORRECTION_CLIENT = 'REGC_CLIENT', MHR_PUBLIC_AMENDMENT = 'PUBA', + MHR_RE_REGISTRATION = 'EXRE' } export enum UIRegistrationTypes { @@ -115,7 +116,10 @@ export enum UIRegistrationTypes { TRANSFER_DUE_TO_DEATH = 'Sale or Gift due to death', NON_RESIDENTIAL_EXEMPTION = 'Non-Residential Exemption', RESIDENTIAL_EXEMPTION = 'Residential Exemption', - TRANSPORT_PERMIT = 'Transport Permit' + TRANSPORT_PERMIT = 'Transport Permit', + + // MHR Re-registration + MANUFACTURED_HOME_RE_REGISTRATION = 'Re-Register Manufactured Home' } export enum StatementTypes { diff --git a/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts b/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts index aa7dd60a3..7e98d9344 100644 --- a/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts +++ b/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts @@ -3,7 +3,7 @@ import { HomeLocationTypes } from '@/enums' export interface MhrRegistrationHomeLocationIF extends MhrRegistrationHomeLocationWithoutAddressIF { address: { street: string - streetAdditional: string + streetAdditional?: string city: string region: string country: string diff --git a/ppr-ui/src/resources/registrationTypes.ts b/ppr-ui/src/resources/registrationTypes.ts index f25bfb1eb..0ab618ec0 100644 --- a/ppr-ui/src/resources/registrationTypes.ts +++ b/ppr-ui/src/resources/registrationTypes.ts @@ -331,6 +331,17 @@ export const MhrRegistrationType: RegistrationTypeIF = { `${UIRegistrationTypes.MANUFACTURED_HOME_REGISTRATION} (${APIRegistrationTypes.MANUFACTURED_HOME_REGISTRATION})` } +export const MhrReRegistrationType: RegistrationTypeIF = { + class: 'registration-list-item', + disabled: false, + divider: false, + group: 3, + registrationTypeUI: UIRegistrationTypes.MANUFACTURED_HOME_RE_REGISTRATION, + registrationTypeAPI: APIRegistrationTypes.MHR_RE_REGISTRATION, + text: + `${UIRegistrationTypes.MANUFACTURED_HOME_RE_REGISTRATION} (${APIRegistrationTypes.MHR_RE_REGISTRATION})` +} + export const MhrCorrectionStaff: RegistrationTypeIF = { class: 'registration-list-item', disabled: false, diff --git a/ppr-ui/src/store/store.ts b/ppr-ui/src/store/store.ts index e741f3d84..39f2899ac 100644 --- a/ppr-ui/src/store/store.ts +++ b/ppr-ui/src/store/store.ts @@ -237,6 +237,10 @@ export const useStore = defineStore('assetsStore', () => { APIRegistrationTypes.MHR_PUBLIC_AMENDMENT ].includes(state.value.registration?.registrationType?.registrationTypeAPI) }) + const isMhrReRegistration = computed(() => { + return isRoleStaffReg.value && + state.value.registration?.registrationType?.registrationTypeAPI === APIRegistrationTypes.MHR_RE_REGISTRATION + }) const isMhrStaffRegistration = computed(() => { return isMhrRegistration.value && isRoleStaff.value }) @@ -257,7 +261,7 @@ export const useStore = defineStore('assetsStore', () => { useMhrValidations(modelRef).getStepValidation(MhrSectVal.SUBMITTING_PARTY_VALID) && useMhrValidations(modelRef).getStepValidation(MhrSectVal.HOME_OWNERS_VALID) && useMhrValidations(modelRef).getStepValidation(MhrSectVal.LOCATION_VALID) && - useMhrCorrections().hasMadeMhrCorrections.value + (isMhrReRegistration.value ? true : useMhrCorrections().hasMadeMhrCorrections.value) }) const isMhrManufacturerRegistrationReviewValid = computed(() => { const modelRef = toRefs(getMhrRegistrationValidationModel.value) @@ -538,7 +542,9 @@ export const useStore = defineStore('assetsStore', () => { return isMhrManufacturerRegistration.value ? getMhrManufacturerSteps.value : getMhrStaffSteps.value }) const getFooterButtonConfig = computed(() => { - return isMhrRegistration.value ? getMhrButtonFooterConfig.value : RegistrationButtonFooterConfig + return isMhrRegistration.value || isMhrReRegistration.value + ? getMhrButtonFooterConfig.value + : RegistrationButtonFooterConfig }) const getMhrButtonFooterConfig = computed(() => { return isMhrManufacturerRegistration.value @@ -1266,6 +1272,10 @@ export const useStore = defineStore('assetsStore', () => { } // MHR Information + function setMhrNumber (mhrNumber: string) { + state.value.mhrInformation.mhrNumber = mhrNumber + } + function setMhrInformation (mhrInfo: MhRegistrationSummaryIF) { state.value.mhrInformation = mhrInfo } @@ -1529,6 +1539,7 @@ export const useStore = defineStore('assetsStore', () => { getRegistrationNumber, getRegistrationType, isMhrRegistration, + isMhrReRegistration, isMhrStaffRegistration, isMhrManufacturerRegistration, isMhrRegistrationReviewValid, @@ -1745,6 +1756,7 @@ export const useStore = defineStore('assetsStore', () => { setMhrRegistrationOwnLand, // MHR Information + setMhrNumber, setMhrInformation, setMhrInformationDraftId, setMhrStatusType, diff --git a/ppr-ui/src/utils/utilities.ts b/ppr-ui/src/utils/utilities.ts index b85f6a93e..67a698789 100644 --- a/ppr-ui/src/utils/utilities.ts +++ b/ppr-ui/src/utils/utilities.ts @@ -45,7 +45,7 @@ export function addTimestampToDate (dateToConvert: string, isEndDate: boolean): * have a non-object property with a truthy value */ export function hasTruthyValue (obj: object) { - return Object.values(obj).some( + return obj && Object.values(obj).some( (value) => !!value && (typeof value === 'object' ? hasTruthyValue(value) : true) ) } diff --git a/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue b/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue index f03353cc6..276c74469 100644 --- a/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue +++ b/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue @@ -3,8 +3,8 @@ id="mhr-home-location" class="increment-sections" > - -