feat(ui): settle off-machine, glossary links, alerts pubkey
Settle action on the cash_owed/partial_pending worklist buckets and the settlements table; the worklist's error cell links the raw code to the glossary entry; the platform settings dialog gains the alerts pubkey.
This commit is contained in:
parent
7375112638
commit
cdb1fe71cc
2 changed files with 114 additions and 2 deletions
|
|
@ -108,7 +108,8 @@ window.app = Vue.createApp({
|
|||
super_cash_in_fee_fraction: 0,
|
||||
super_cash_out_fee_fraction: 0,
|
||||
super_fee_wallet_id: '',
|
||||
max_cash_in_sats: null
|
||||
max_cash_in_sats: null,
|
||||
alerts_pubkey: ''
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -261,6 +262,13 @@ window.app = Vue.createApp({
|
|||
dispensed_sats: null,
|
||||
notes: ''
|
||||
},
|
||||
// ADR-005 §6 — settle an owed-cash settlement off-machine
|
||||
settleDialog: {
|
||||
show: false,
|
||||
settlement: null,
|
||||
note: '',
|
||||
saving: false
|
||||
},
|
||||
noteDialog: {
|
||||
show: false,
|
||||
saving: false,
|
||||
|
|
@ -659,7 +667,8 @@ window.app = Vue.createApp({
|
|||
super_cash_out_fee_fraction:
|
||||
this.superConfig?.super_cash_out_fee_fraction ?? 0,
|
||||
super_fee_wallet_id: this.superConfig?.super_fee_wallet_id || '',
|
||||
max_cash_in_sats: this.superConfig?.max_cash_in_sats ?? null
|
||||
max_cash_in_sats: this.superConfig?.max_cash_in_sats ?? null,
|
||||
alerts_pubkey: this.superConfig?.alerts_pubkey || ''
|
||||
}
|
||||
this.superFeeDialog.show = true
|
||||
},
|
||||
|
|
@ -1263,6 +1272,45 @@ window.app = Vue.createApp({
|
|||
this.partialDispenseDialog.show = true
|
||||
},
|
||||
|
||||
// ADR-005 §6 — the operator paid the customer by hand; close both ledgers.
|
||||
openSettleCashOwed(settlement) {
|
||||
this.settleDialog.settlement = settlement
|
||||
this.settleDialog.note = ''
|
||||
this.settleDialog.show = true
|
||||
},
|
||||
|
||||
async submitSettleCashOwed() {
|
||||
const d = this.settleDialog
|
||||
d.saving = true
|
||||
try {
|
||||
const {data} = await LNbits.api.request(
|
||||
'POST',
|
||||
`${SETTLEMENTS_PATH}/${d.settlement.id}/settle-cash-owed`,
|
||||
null,
|
||||
{note: d.note}
|
||||
)
|
||||
this._replaceSettlement(data)
|
||||
d.show = false
|
||||
Quasar.Notify.create({
|
||||
type: 'positive',
|
||||
message:
|
||||
'Settled — distributing the full amount; the machine will mark its row remediated'
|
||||
})
|
||||
if (this.worklist.totalCount) await this.loadWorklist()
|
||||
} catch (e) {
|
||||
this._notifyError(e, 'Settle failed')
|
||||
} finally {
|
||||
d.saving = false
|
||||
}
|
||||
},
|
||||
|
||||
// Deep link into the error glossary for a settlement's dispenser error.
|
||||
errorGlossaryHref(settlement) {
|
||||
const code = settlement.dispense_raw_code || settlement.dispense_error_code || ''
|
||||
const anchor = code.toLowerCase().replace(/[^a-z0-9]+/g, '-')
|
||||
return `/spirekeeper/static/docs/errors.html${anchor ? '#' + anchor : ''}`
|
||||
},
|
||||
|
||||
// ADR-005 §5 — release a machine's cash-out hold after a terminal
|
||||
// dispenser fault, when the jam was cleared without a recount.
|
||||
confirmResumeCashOut(machine) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue