diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 78ede419c..d49c87ec0 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "2.1.19", + "version": "2.1.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "2.1.19", + "version": "2.1.20", "dependencies": { "@bcrs-shared-components/corp-type-module": "^1.0.7", "@bcrs-shared-components/enums": "^1.0.19", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 51856f351..379eac4f9 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "2.1.19", + "version": "2.1.20", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/composables/mhrInformation/useMhrUnitNote.ts b/ppr-ui/src/composables/mhrInformation/useMhrUnitNote.ts index 35d597e66..e6190bd46 100644 --- a/ppr-ui/src/composables/mhrInformation/useMhrUnitNote.ts +++ b/ppr-ui/src/composables/mhrInformation/useMhrUnitNote.ts @@ -6,6 +6,7 @@ import { storeToRefs } from 'pinia' import { cloneDeep } from 'lodash' import { computed } from 'vue-demi' import { AdminRegistrationNotes, UnitNotesInfo } from '@/resources' +import { useNewMhrRegistration } from '../mhrRegistration' export const useMhrUnitNote = () => { const { @@ -19,6 +20,10 @@ export const useMhrUnitNote = () => { setMhrUnitNoteRegistration } = useStore() + const { + parseStaffPayment + } = useNewMhrRegistration() + // Build Unit Note payload data with all the submission rules const buildPayload = (unitNoteData: UnitNoteRegistrationIF): UnitNoteRegistrationIF => { // Person Giving Notice is optional for Decal Replacement (102), Public Note (NPUB), Confidential Note (NCON) @@ -76,7 +81,7 @@ export const useMhrUnitNote = () => { const payloadData = buildPayload(cloneDeep(unitNoteData)) // determine if it's admin registration based on document type const isAdminRegistration = !!AdminRegistrationNotes.includes(unitNoteData.note.documentType) - return submitMhrUnitNote(getMhrInformation.value.mhrNumber, payloadData, isAdminRegistration) + return submitMhrUnitNote(getMhrInformation.value.mhrNumber, payloadData, isAdminRegistration, parseStaffPayment()) } // Make optional Person Giving Notice fields for certain Unit Note types diff --git a/ppr-ui/src/utils/mhr-api-helper.ts b/ppr-ui/src/utils/mhr-api-helper.ts index fb71b0d60..a38e40743 100644 --- a/ppr-ui/src/utils/mhr-api-helper.ts +++ b/ppr-ui/src/utils/mhr-api-helper.ts @@ -433,11 +433,12 @@ export async function submitMhrTransfer (payloadData, mhrNumber, staffPayment) { } // Register a Unit Note on an existing manufactured home. -export async function submitMhrUnitNote (mhrNumber, payloadData, isAdminRegistration) { +export async function submitMhrUnitNote (mhrNumber, payloadData, isAdminRegistration, staffPayment) { try { + const paymentParams = mhrStaffPaymentParameters(staffPayment) // different Unit Notes are submitted to different endpoints const endpoint = isAdminRegistration ? `admin-registrations/${mhrNumber}` : `notes/${mhrNumber}` - const result = await axios.post(endpoint, payloadData, getDefaultConfig()) + const result = await axios.post(`${endpoint}?${paymentParams}`, payloadData, getDefaultConfig()) if (!result?.data) { throw new Error('Invalid API response') }