diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index b3cedd4ca..dbf5e035f 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.2.9", + "version": "3.2.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.2.9", + "version": "3.2.10", "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 c7179bce7..62684c827 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.2.9", + "version": "3.2.10", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/components/registration/securities-act-notices/NoticePanel.vue b/ppr-ui/src/components/registration/securities-act-notices/NoticePanel.vue index 831c7487c..dba757c76 100644 --- a/ppr-ui/src/components/registration/securities-act-notices/NoticePanel.vue +++ b/ppr-ui/src/components/registration/securities-act-notices/NoticePanel.vue @@ -156,7 +156,7 @@ @@ -315,7 +315,7 @@ @@ -547,19 +547,21 @@ const togglePanel = (isCancel: boolean = false) => { /** Set Notices to Store and close active panels **/ const setAndCloseNotice = (isUndo = false): void => { - // Determine the action for each notice: mark as edited if it has changes, + // Amendments: Determine the action for each notice - mark as edited if it has changes, // retain added/removed notices, otherwise omit the action property. - const notices = getSecuritiesActNotices.value.map((notice, index) => { - const originalNotice = getOriginalSecuritiesActNotices.value[index] - const isAdded = notice.action === ActionTypes.ADDED - const isRemoved = notice.action === ActionTypes.REMOVED - const isEdited = !isAdded && !isEqual(omit(notice, 'action'), omit(originalNotice, 'action')) - - if (isEdited) { - return { ...notice, action: ActionTypes.EDITED } - } - return (isAdded || isRemoved) ? { ...notice } : omit(notice, 'action') - }) + const notices = props.isAmendment + ? getSecuritiesActNotices.value.map((notice, index) => { + const originalNotice = getOriginalSecuritiesActNotices.value[index] + const isAdded = notice.action === ActionTypes.ADDED + const isRemoved = notice.action === ActionTypes.REMOVED + const isEdited = !isAdded && !isEqual(omit(notice, 'action'), omit(originalNotice, 'action')) + + if (isEdited) { + return { ...notice, action: ActionTypes.EDITED } + } + return (isAdded || isRemoved) ? { ...notice } : omit(notice, 'action') + }) + : getSecuritiesActNotices.value setSecuritiesActNotices([...notices]) // Close expanded panel diff --git a/ppr-ui/src/utils/registration-helper.ts b/ppr-ui/src/utils/registration-helper.ts index 751075d9a..01b1d7813 100644 --- a/ppr-ui/src/utils/registration-helper.ts +++ b/ppr-ui/src/utils/registration-helper.ts @@ -390,6 +390,11 @@ export async function saveFinancingStatementDraft (stateModel:StateModelIF): Pro statement.lienAmount = trustLength.lienAmount statement.surrenderDate = trustLength.surrenderDate } + if (registrationType.registrationTypeAPI === APIRegistrationTypes.SECURITY_ACT_NOTICE) { + statement.securitiesActNotices = stateModel.registration.securitiesActNotices + statement.lienAmount = trustLength.lienAmount + statement.surrenderDate = trustLength.surrenderDate + } // Step 2. setup const parties:AddPartiesIF = stateModel.registration.parties statement.registeringParty = parties.registeringParty @@ -588,6 +593,9 @@ export async function setupFinancingStatementDraft (stateModel:StateModelIF, doc stateModel.registration.lengthTrust.valid = (stateModel.registration.lengthTrust.lifeYears > 0 || stateModel.registration.lengthTrust.lifeInfinite === true) } + if (draft.financingStatement.type === APIRegistrationTypes.SECURITY_ACT_NOTICE) { + stateModel.registration.securitiesActNotices = draft.financingStatement.securitiesActNotices + } // Step 2 setup if (draft.financingStatement.registeringParty) {