Skip to content

Commit

Permalink
SAN Drafts (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds authored Jun 5, 2024
1 parent 5b77218 commit 9cca573
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
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.9",
"version": "3.2.10",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
</v-list-item>

<v-list-item
v-if="notice.action === ActionTypes.EDITED"
v-if="isAmendment && notice.action === ActionTypes.EDITED"
:data-test-id="`security-notice-amend-drop-option`"
@click="toggleNoticeForm('editNotice')"
>
Expand Down Expand Up @@ -315,7 +315,7 @@
<!-- Drop down list -->
<v-list>
<v-list-item
v-if="order.action === ActionTypes.EDITED"
v-if="isAmendment && order.action === ActionTypes.EDITED"
:data-test-id="'security-order-amend-drop'"
@click="toggleNoticeForm('editOrder', index)"
>
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions ppr-ui/src/utils/registration-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9cca573

Please sign in to comment.