Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRS Configurations and Minor Text Updates #2044

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ppr-ui/devops/vaults.env
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ VUE_APP_BCOL_STAFF_PARTY_CODE="op://ppr/$APP_ENV/ppr-ui/BCOL_STAFF_PARTY_CODE"
#vaults web-url
VUE_APP_REGISTRY_URL="op://web-url/$APP_ENV/registry/REGISTRY_URL"
VUE_APP_AUTH_WEB_URL="op://web-url/$APP_ENV/auth-web/AUTH_WEB_URL"
VUE_APP_DOCUMENTS_UI_URL="op://web-url/$APP_ENV/documents-ui/DOCUMENTS_UI_URL"
VUE_APP_SITEMINDER_LOGOUT_URL="op://web-url/$APP_ENV/siteminder/SITEMINDER_LOGOUT_URL"

#vaults API
@@ -24,6 +25,9 @@ VUE_APP_MHR_API_KEY="op://API/$APP_ENV/ppr-api/MHR_API_KEY"
VUE_APP_LTSA_API_URL="op://API/$APP_ENV/ltsa-api/LTSA_API_URL"
VUE_APP_LTSA_API_VERSION="op://API/$APP_ENV/ltsa-api/LTSA_API_VERSION"
VUE_APP_LTSA_API_KEY="op://API/$APP_ENV/ltsa-api/LTSA_API_KEY"
VUE_APP_DOC_API_URL="op://API/$APP_ENV/doc-api/DOC_API_URL"
VUE_APP_DOC_API_VERSION="op://API/$APP_ENV/doc-api/DOC_API_VERSION"
VUE_APP_DOC_API_KEY="op://API/$APP_ENV/doc-api/DOC_API_KEY"
VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL"
VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION"
VUE_APP_STATUS_API_URL="op://API/$APP_ENV/status-api/STATUS_API_URL"
4 changes: 2 additions & 2 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "3.2.66",
"version": "3.2.67",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
2 changes: 1 addition & 1 deletion ppr-ui/src/components/mhrTransfers/TransferDetails.vue
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@
class="pl-3"
>
<p>
Is the manufactured home located on land that the
Will the manufactured home be located on land that the
{{ isNewHomeOwner ? 'new' : '' }} homeowners own or on land that
they have a registered lease of 3 years or more?
</p>
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
A certificate or confirmation in electronic format that confirms that no
property taxes are unpaid. Reference Manufactured Home Act sections 25 and 26(2).
</v-tooltip></strong>
showing that all local taxes for the current year have been paid is required for
showing that all local taxes for the current year have been paid is required in most cases for
manufactured homes that:
<ol
type="a"
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
A certificate or confirmation in electronic format that confirms that no
property taxes are unpaid. Reference Manufactured Home Act sections 25 and 26(2).
</v-tooltip></strong>
showing that all local taxes for the current year have been paid is required for
showing that all local taxes for the current year have been paid is required in most cases for
manufactured homes that:
<ol
type="a"
Original file line number Diff line number Diff line change
@@ -170,7 +170,7 @@
:class="{ 'border-error-left': state.isLandOwnershipInvalid }"
:validate="state.isLandOwnershipInvalid"
:content="{
description: 'Is the manufactured home located on land that the homeowners ' +
description: 'Will the manufactured home be located on land that the homeowners ' +
'own or on land that they have a registered lease of 3 years or more?'
}"
:updatedBadge="isAmendLocationActive ? state.amendedBadgeHomeLandOwnership : null"
51 changes: 28 additions & 23 deletions ppr-ui/src/composables/userAccess/useUserAccess.ts
Original file line number Diff line number Diff line change
@@ -322,33 +322,38 @@ export const useUserAccess = () => {
}

/**
* Disable manufacturer transfer based on name match conditions and restricted to Sole Owners
* Disable manufacturer/dealer transfer based on name match conditions and restricted to Sole Owners
* @returns {Promise<boolean>} Promise that returns true when Manufacturer matches name records and is a sole owner
*/
const disableDealerManufacturerTransfer = async (isDealer: boolean = false): Promise<boolean> => {
let isSoleOwner: boolean, isNameMatch: boolean, currentOwnerName: string

// First verify a single owner group & SOLE ownership
if (getMhrTransferCurrentHomeOwnerGroups.value.length === 1) {
isSoleOwner = getMhrTransferCurrentHomeOwnerGroups.value[0].type === ApiHomeTenancyTypes.SOLE
currentOwnerName = getMhrTransferCurrentHomeOwnerGroups.value[0]?.owners[0]?.organizationName
} else return true

// If a Sole Owner: Fetch and verify the sole owner name matches the dealers/manufacturers records org or dba name
if (isSoleOwner) {
let orgName, dbaName
if (isDealer) {
const dealerData: MhrQsPayloadIF = await getQualifiedSupplier()
orgName = dealerData?.businessName
dbaName = dealerData?.dbaName
} else {
const manufacturerData: MhrManufacturerInfoIF = await getMhrManufacturerInfo()
orgName = manufacturerData?.ownerGroups[0]?.owners[0]?.organizationName
dbaName = manufacturerData?.dbaName
}
isNameMatch = (currentOwnerName === orgName || currentOwnerName === dbaName)
} else return true
// Ensure there is only one owner group and it's a sole ownership
const ownerGroups = getMhrTransferCurrentHomeOwnerGroups.value
if (ownerGroups.length !== 1) return true

const isSoleOwner = ownerGroups[0].type === ApiHomeTenancyTypes.SOLE
const currentOwnerName = ownerGroups[0]?.owners[0]?.organizationName || ''

// If not a sole owner, return true (disabling the transfer)
if (!isSoleOwner) return true

// Fetch dealer or manufacturer data based on the provided flag
let orgName: string | undefined
let dbaName: string | undefined

if (isDealer) {
const dealerData: MhrQsPayloadIF = await getQualifiedSupplier()
orgName = dealerData?.businessName
dbaName = dealerData?.dbaName
} else {
const manufacturerData: MhrManufacturerInfoIF = await getMhrManufacturerInfo()
orgName = manufacturerData?.ownerGroups[0]?.owners[0]?.organizationName
dbaName = manufacturerData?.dbaName
}

// Check if current owner's name matches the dealer/manufacturer records (either org or dba name)
const isNameMatch = currentOwnerName === orgName || currentOwnerName === dbaName

// Disable transfer if the name doesn't match
return !isNameMatch
}

2 changes: 1 addition & 1 deletion ppr-ui/src/views/newMhrRegistration/HomeLocation.vue
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@
:validate="validateLandDetails"
:class="{ 'border-error-left': validateLandDetails }"
:content="{
description: 'Is the manufactured home located on land that the homeowners own or on ' +
description: 'Will the manufactured home be located on land that the homeowners own or on ' +
'land that they have a registered lease of 3 years or more?'
}"
:updatedBadge="(isMhrCorrection || isMhrReRegistration) ? correctionState.landDetails : null"
2 changes: 1 addition & 1 deletion ppr-ui/tests/unit/MhrTransportPermit.spec.ts
Original file line number Diff line number Diff line change
@@ -151,7 +151,7 @@ describe('MhrTransportPermit', () => {
expect(locationChange.findComponent(TaxCertificate).exists()).toBe(true)

const homeLandOwnershipText = locationChange.findComponent(HomeLandOwnership).text()
expect(homeLandOwnershipText).toContain('Is the manufactured home')
expect(homeLandOwnershipText).toContain('Will the manufactured home')
})

it('should render all validation errors', async () => {