Skip to content

Commit

Permalink
Create New Permit
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds committed Oct 10, 2024
1 parent 5eedd17 commit ad8343d
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 44 deletions.
1 change: 1 addition & 0 deletions ppr-ui/src/components/common/InfoChip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default defineComponent({
case 'HISTORICAL':
case 'CANCELLED':
case 'VOID':
case 'COMPLETED':
return { bgColor: 'grey-lighten-2' }
case 'LIEN':
case 'LOCKED':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,38 @@
/>
</div>

<div
v-if="isNewPermitActive && !isTransportPermitReview"
class="px-7 mt-5"
>
<div class="d-flex align-center">
<v-icon
size="21"
color="darkBlue"
>
mdi-map-marker
</v-icon>

<h4 class="fs-16 lh-24 pl-2">
Current Registered Location
</h4>
</div>
<v-divider
class="border-opacity-15 mt-4"
/>
</div>

<div
:class="[
{'border-error-left': showStepError && !isTransferReview && !isTransportPermitReview && !isMhrCorrection},
{'border-error-left': showStepError && !isTransferReview && !isTransportPermitReview && !isMhrCorrection &&
!isCreateNewPermit},
{'cancelled-location-info': isCancelChangeLocationActive && !isPrevTransportPermitLocation &&
!isCancelTransportPermitReview && !isCancelledTransportPermitDetails},
{'restored-location-info': isCancelChangeLocationActive && isPrevTransportPermitLocation}
]"
>
<section
v-if="showStepError && !isTransferReview && !isTransportPermitReview && !isMhrCorrection"
v-if="showStepError && !isTransferReview && !isTransportPermitReview && !isMhrCorrection && !isCreateNewPermit"
:class="{ 'pb-8': !(!!homeLocationInfo.locationType) && !hasAddress }"
class="mx-6 pt-8"
>
Expand Down Expand Up @@ -87,7 +109,8 @@
!isChangeLocationActive &&
!isCorrectionReview &&
!isPrevTransportPermitLocation &&
!isCancelTransportPermitReview) || isExtendChangeLocationActive"
!isCancelTransportPermitReview &&
!isCreateNewPermit) || isExtendChangeLocationActive"
:isCancelledLocation="isCancelledTransportPermitDetails"
:isVoidPermit="isExemptionWithActiveTransportPermit"
:infoText="exemptionWithActivePermitText"
Expand Down Expand Up @@ -461,7 +484,10 @@
</v-row>

<!-- Civic Address -->
<v-divider class="mx-8 mt-6" />
<v-divider
v-if="!isCreateNewPermit"
class="mx-8 mt-6"
/>
<v-row
noGutters
class="px-8 pt-5 key-value-pair"
Expand Down Expand Up @@ -516,10 +542,14 @@
!(isMhrCorrection && hasActiveTransportPermit) && !isCancelChangeLocationActive &&
!isExtendChangeLocationActive"
>
<v-divider class="mx-8 mt-6" />
<v-divider
v-if="!isCreateNewPermit"
class="mx-8 mt-6"
/>

<!-- Land Details -->
<v-row
v-if="!isCreateNewPermit"
noGutters
class="px-8 pt-6"
>
Expand All @@ -533,6 +563,7 @@

<!-- Lease or Land Ownership -->
<v-row
v-if="!isCreateNewPermit"
noGutters
class="px-8 pt-1 key-value-pair"
>
Expand Down Expand Up @@ -659,6 +690,10 @@ export default defineComponent({
isExtendChangeLocationReview: {
type: Boolean,
default: false
},
isCreateNewPermit: {
type: Boolean,
default: false
}
},
setup (props) {
Expand Down Expand Up @@ -689,6 +724,7 @@ export default defineComponent({
const countryProvincesHelpers = useCountriesProvinces()
const { required, notEqualTo, customRules } = useInputRules()
const {
isNewPermitActive,
hasActiveTransportPermit,
isChangeLocationActive,
isAmendLocationActive,
Expand All @@ -702,9 +738,9 @@ export default defineComponent({
const { isExemptionWithActiveTransportPermit, exemptionLabel } = useExemptions()
const homeLocationInfo: MhrRegistrationHomeLocationIF =
(props.isPrevTransportPermitLocation || props.isCancelTransportPermitReview || props.isExtendChangeLocationReview)
(props.isPrevTransportPermitLocation || props.isCancelTransportPermitReview)
? getMhrTransportPermitPreviousLocation.value
: props.isTransportPermitReview
: (props.isTransportPermitReview && !props.isExtendChangeLocationReview)
? getMhrTransportPermit.value.newLocation
: getMhrRegistrationLocation.value
Expand Down Expand Up @@ -824,6 +860,7 @@ export default defineComponent({
}, { immediate: true })
return {
isNewPermitActive,
homeLocationInfo,
newPadNumberRef,
HomeLocationTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useStore } from '@/store/store'
import { storeToRefs } from 'pinia'
import { convertDate } from '@/utils'
import { addDaysToDate, pacificDate, shortPacificDate } from '@/utils/date-helper'
import { InfoChip, UpdatedBadge } from '@/components/common'
import { useTransportPermits } from '@/composables'
const { getMhrInformation } = storeToRefs(useStore())
Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/components/mhrTransportPermit/LocationChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/>

<FormCard
v-if="!isAmendLocationActive && !isExtendChangeLocationActive"
v-if="!isAmendLocationActive && !isExtendChangeLocationActive && !isNewPermitActive"
label="Location Change Type"
:showErrors="validate && !state.locationChangeFromValid"
:class="{'border-error-left': validate && !state.locationChangeFromValid}"
Expand Down Expand Up @@ -242,6 +242,7 @@ const {
} = storeToRefs(useStore())
const {
isNewPermitActive,
setLocationChangeType,
resetTransportPermit,
isNotManufacturersLot,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<article
id="transport-permit-details"
class="px-8 pt-6"
class="px-8 py-6"
:class="[
{ 'cancelled-transport-permit-details': isCancelledLocation },
{ 'cancelled-transport-permit-details': isCancelledLocation || isCompletedLocation },
{ 'void-transport-permit-details': isVoidPermit }
]"
>
Expand All @@ -19,13 +19,18 @@
data-test-id="void-transport-permit-badge"
/>
<h4 class="fs-16 lh-24">
Transport Permit Details
Transport Permit {{ isCompletedLocation ? '' : 'Details' }}
</h4>
<InfoChip
v-if="isCancelledLocation"
class="ml-2"
action="CANCELLED"
/>
<InfoChip
v-if="isCompletedLocation"
class="ml-2"
action="COMPLETED"
/>
</v-col>
</v-row>

Expand Down Expand Up @@ -83,7 +88,10 @@
}}
</v-col>
</v-row>
<v-divider class="transport-permit-divider my-6" />
<v-divider
v-if="!isCompletedLocation"
class="transport-permit-divider mt-6"
/>
</article>
</template>

Expand All @@ -99,10 +107,12 @@ const { getMhrInformation } = storeToRefs(useStore())
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = withDefaults(defineProps<{
isCancelledLocation?: boolean,
isCompletedLocation?: boolean,
isVoidPermit?: boolean,
infoText?: string
}>(), {
isCancelledLocation: false,
isCompletedLocation: false,
isVoidPermit: false,
infoText: ''
})
Expand All @@ -122,7 +132,7 @@ h3 {
.transport-details-header {
display: contents;
}
dd, dt, .transport-details-header h3 {
dd, dt, .transport-details-header, .tp-header, .tp-label {
opacity: 0.4;
}
}
Expand Down
11 changes: 11 additions & 0 deletions ppr-ui/src/composables/mhrInformation/useTransportPermits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const isChangeLocationActive: Ref<boolean> = ref(false)
const isAmendLocationActive: Ref<boolean> = ref(false)
const isCancelChangeLocationActive: Ref<boolean> = ref(false)
const isExtendChangeLocationActive: Ref<boolean> = ref(false)
const isNewPermitActive: Ref<boolean> = ref(false)


export const useTransportPermits = () => {
Expand Down Expand Up @@ -127,6 +128,11 @@ export const useTransportPermits = () => {
isExtendChangeLocationActive.value = val
}

/** Toggle Extend location change flow **/
const setNewPermitChange = (val: boolean) => {
isNewPermitActive.value = val
}

const setLocationChangeType = (locationChangeType: LocationChangeTypes) => {
setMhrTransportPermitLocationChangeType(locationChangeType)
}
Expand Down Expand Up @@ -235,6 +241,9 @@ export const useTransportPermits = () => {
...(isRoleQualifiedSupplier.value && {
clientReferenceId: getMhrTransferAttentionReference.value || ''
}),
...(isNewPermitActive.value && {
moveCompleted: true
}),
submittingParty: {
...submittingParty,
phoneNumber: fromDisplayPhone(submittingParty?.phoneNumber)
Expand Down Expand Up @@ -399,6 +408,7 @@ export const useTransportPermits = () => {
initTransportPermit,
resetTransportPermit,
isChangeLocationActive,
isNewPermitActive,
isAmendLocationActive,
isCancelChangeLocationActive,
isExtendChangeLocationActive,
Expand All @@ -416,6 +426,7 @@ export const useTransportPermits = () => {
isValueAmended,
hasAmendmentChanges,
setLocationChange,
setNewPermitChange,
setLocationChangeType,
setAmendLocationChange,
setCancelLocationChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface MhrTransportPermitIF {
documentId?: string
clientReferenceId?: string
attentionReference?: string
moveCompleted?: boolean
submittingParty: SubmittingPartyIF,
locationChangeType: LocationChangeTypes,
newLocation: MhrRegistrationHomeLocationIF,
Expand Down
1 change: 1 addition & 0 deletions ppr-ui/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default defineComponent({
setMhrDraftNumber('')
useTransportPermits().setLocationChange(false)
useTransportPermits().setExtendLocationChange(false)
useTransportPermits().setNewPermitChange(false)
onAppReady(props.appReady)
})
Expand Down
24 changes: 23 additions & 1 deletion ppr-ui/src/views/mhrInformation/MhrInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@
setMsg="This information must match the information on the bill of sale."
/>

<CautionBox
v-if="isReviewMode && isNewPermitActive"
class="my-9"
:setMsg="`Creating a new transport can only be performed once the manufactured home has been transported
to the current registered location. When the new transport permit is issued, the current Transport Permit
${getMhrInformation.permitRegistrationNumber} will no longer be valid.`"
/>

<!-- Mhr Information Body -->
<section
v-if="dataLoaded"
Expand Down Expand Up @@ -231,6 +239,16 @@
id="location-change-review"
>
<LocationChangeReview />

<v-card
v-if="isNewPermitActive"
flat
class="mt-2"
>
<TransportPermitDetails
isCompletedLocation
/>
</v-card>
</section>

<section
Expand Down Expand Up @@ -680,7 +698,7 @@ import {
LocationChangeConfirmCompletion,
TransportPermitConfirmCompletion,
AmendTransportPermitConfirmCompletion,
CancelTransportPermitConfirmCompletion
CancelTransportPermitConfirmCompletion, TransportPermitDetails
} from '@/components/mhrTransportPermit'
import {
AccountInfoIF,
Expand Down Expand Up @@ -708,6 +726,7 @@ import {
export default defineComponent({
name: 'MhrInformation',
components: {
TransportPermitDetails,
Attention,
BaseDialog,
CautionBox,
Expand Down Expand Up @@ -844,6 +863,7 @@ export default defineComponent({
const { buildLocationChange } = useMhrCorrections()
const { disableDealerManufacturerTransfer, disableDealerManufacturerLocationChange } = useUserAccess()
const {
isNewPermitActive,
isChangeLocationActive,
isChangeLocationEnabled,
isAmendLocationActive,
Expand Down Expand Up @@ -1322,6 +1342,7 @@ export default defineComponent({
if (isValidTransfer.value || isValidTransportPermit.value || isValidExtendTransportPermit.value) {
localState.isReviewMode = true
localState.validate = false
scrollToTop()
}
// Force show removed/deceased homeOwners when invalid
Expand Down Expand Up @@ -1560,6 +1581,7 @@ export default defineComponent({
}, { immediate: true })
return {
isNewPermitActive,
isRoleStaffSbc,
isRoleStaffReg,
isFrozenMhr,
Expand Down
Loading

0 comments on commit ad8343d

Please sign in to comment.