From f7c7d52a93e4b8c564b4e22c9e8c56d88e6c9e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Mon, 13 Dec 2021 16:54:58 +0000 Subject: [PATCH 1/5] refactor: change RBF checkbox wording --- new-lamassu-admin/src/pages/Services/schemas/blockcypher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-lamassu-admin/src/pages/Services/schemas/blockcypher.js b/new-lamassu-admin/src/pages/Services/schemas/blockcypher.js index 11c6cab8..a9e38734 100644 --- a/new-lamassu-admin/src/pages/Services/schemas/blockcypher.js +++ b/new-lamassu-admin/src/pages/Services/schemas/blockcypher.js @@ -27,7 +27,7 @@ export default { settings: { enabled: true, disabledMessage: 'RBF verification not available', - label: 'Enable RBF verification', + label: 'Lower the confidence of RBF transactions', requirement: 'bitcoind' }, face: true From 3213513f54414679c5aa76c2bdcdff4f4520acc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Tue, 14 Dec 2021 12:32:09 +0000 Subject: [PATCH 2/5] refactor: rename cash box/cassette batch operations type --- lib/cashbox-batches.js | 6 +++--- migrations/1617967601902-add-batches-type.js | 18 +++++++++--------- .../src/pages/Maintenance/CashboxHistory.js | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js index c3b8ba99..dfc9d2a6 100644 --- a/lib/cashbox-batches.js +++ b/lib/cashbox-batches.js @@ -5,8 +5,8 @@ const uuid = require('uuid') function createCashboxBatch (deviceId, cashboxCount) { if (_.isEqual(0, cashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created.') - const sql = `INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-in-empty') RETURNING *` - const sql2 = ` + const sql = `INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-box-empty') RETURNING *` + const sql2 = ` UPDATE bills SET cashbox_batch_id=$1 FROM cash_in_txs WHERE bills.cash_in_txs_id = cash_in_txs.id AND @@ -29,7 +29,7 @@ function updateMachineWithBatch (machineContext, oldCashboxCount) { return db.tx(t => { const deviceId = machineContext.deviceId const batchId = uuid.v4() - const q1 = t.none(`INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-in-empty')`, [batchId, deviceId]) + const q1 = t.none(`INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-box-empty')`, [batchId, deviceId]) const q2 = t.none(`UPDATE bills SET cashbox_batch_id=$1 FROM cash_in_txs WHERE bills.cash_in_txs_id = cash_in_txs.id AND cash_in_txs.device_id = $2 AND diff --git a/migrations/1617967601902-add-batches-type.js b/migrations/1617967601902-add-batches-type.js index 20d64368..97532908 100644 --- a/migrations/1617967601902-add-batches-type.js +++ b/migrations/1617967601902-add-batches-type.js @@ -3,15 +3,15 @@ var db = require('./db') exports.up = function (next) { var sqls = [ `CREATE TYPE cashbox_batch_type AS ENUM( - 'cash-in-empty', - 'cash-out-1-refill', - 'cash-out-1-empty', - 'cash-out-2-refill', - 'cash-out-2-empty', - 'cash-out-3-refill', - 'cash-out-3-empty', - 'cash-out-4-refill', - 'cash-out-4-empty' + 'cash-box-empty', + 'cash-cassette-1-refill', + 'cash-cassette-1-empty', + 'cash-cassette-2-refill', + 'cash-cassette-2-empty', + 'cash-cassette-3-refill', + 'cash-cassette-3-empty', + 'cash-cassette-4-refill', + 'cash-cassette-4-empty' )`, `ALTER TABLE cashbox_batches ADD COLUMN operation_type cashbox_batch_type NOT NULL`, `ALTER TABLE cashbox_batches ADD COLUMN bill_count_override SMALLINT`, diff --git a/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.js b/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.js index 2a98fd35..f0171370 100644 --- a/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.js +++ b/new-lamassu-admin/src/pages/Maintenance/CashboxHistory.js @@ -93,14 +93,14 @@ const CashboxHistory = ({ machines, currency }) => { (ret, i) => R.pipe( R.assoc( - `cash-out-${i}-refill`, + `cash-cassette-${i}-refill`, <> Cash-out {i} refill ), R.assoc( - `cash-out-${i}-empty`, + `cash-cassette-${i}-empty`, <> Cash-out {i} emptied @@ -108,7 +108,7 @@ const CashboxHistory = ({ machines, currency }) => { ) )(ret), { - 'cash-in-empty': ( + 'cash-box-empty': ( <> Cash-in emptied From 2fed3a99f2e409e1ebcc4c412f923809c5b8843e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Tue, 14 Dec 2021 17:40:38 +0000 Subject: [PATCH 3/5] refactor: use uniform cash box & cash cassette nomenclature --- new-lamassu-admin/src/pages/Cashout/WizardStep.js | 6 +++--- .../MachineComponents/Cassettes/Cassettes.js | 6 +++--- new-lamassu-admin/src/pages/Machines/Machines.js | 2 +- .../src/pages/Maintenance/CashCassettes.js | 8 ++++---- .../src/pages/Maintenance/CashboxHistory.js | 12 ++++++++---- .../src/pages/Maintenance/Wizard/WizardSplash.js | 2 +- .../src/pages/Maintenance/Wizard/WizardStep.js | 8 ++++---- .../Notifications/sections/FiatBalanceOverrides.js | 4 ++-- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/new-lamassu-admin/src/pages/Cashout/WizardStep.js b/new-lamassu-admin/src/pages/Cashout/WizardStep.js index b910cf01..f292503b 100644 --- a/new-lamassu-admin/src/pages/Cashout/WizardStep.js +++ b/new-lamassu-admin/src/pages/Cashout/WizardStep.js @@ -162,14 +162,14 @@ const WizardStep = ({ {lastStep && (
- Cash-out Bill Count + Cash Cassette Bill Count

When enabling cash-out, your bill count will be automatically set to zero. Make sure you physically put cash inside the cash cassettes to allow the machine to dispense it to your users. If you already did, - make sure you set the correct cash-out bill count for this machine - on your Cash Cassettes tab under Maintenance. + make sure you set the correct cash cassette bill count for this + machine on your Cash Boxes & Cassettes tab under Maintenance.

Default Commissions diff --git a/new-lamassu-admin/src/pages/Machines/MachineComponents/Cassettes/Cassettes.js b/new-lamassu-admin/src/pages/Machines/MachineComponents/Cassettes/Cassettes.js index 8d51b5df..4156d3ed 100644 --- a/new-lamassu-admin/src/pages/Machines/MachineComponents/Cassettes/Cassettes.js +++ b/new-lamassu-admin/src/pages/Machines/MachineComponents/Cassettes/Cassettes.js @@ -26,7 +26,7 @@ const widthsByNumberOfCassettes = { const ValidationSchema = Yup.object().shape({ name: Yup.string().required('Required'), cashbox: Yup.number() - .label('Cashbox') + .label('Cash box') .required() .integer() .min(0) @@ -101,7 +101,7 @@ const CashCassettes = ({ machine, config, refetchData }) => { const elements = [ { name: 'cashbox', - header: 'Cashbox', + header: 'Cash box', width: widthsByNumberOfCassettes[numberOfCassettes].cashbox, stripe: false, view: value => ( @@ -119,7 +119,7 @@ const CashCassettes = ({ machine, config, refetchData }) => { it => { elements.push({ name: `cassette${it}`, - header: `Cash-out ${it}`, + header: `Cash cassette ${it}`, width: widthsByNumberOfCassettes[numberOfCassettes].cassette, stripe: true, doubleHeader: 'Cash-out', diff --git a/new-lamassu-admin/src/pages/Machines/Machines.js b/new-lamassu-admin/src/pages/Machines/Machines.js index 89c13f24..9083edb5 100644 --- a/new-lamassu-admin/src/pages/Machines/Machines.js +++ b/new-lamassu-admin/src/pages/Machines/Machines.js @@ -97,7 +97,7 @@ const Machines = () => {
- {'Cash cassettes'} + {'Cash box & cassettes'} { }, { name: 'cashbox', - header: 'Cash-in', + header: 'Cash box', width: maxNumberOfCassettes > 2 ? 140 : 280, view: value => ( @@ -270,9 +270,9 @@ const CashCassettes = () => { return ( <> { `cash-cassette-${i}-refill`, <> - Cash-out {i} refill + + Cash cassette {i} refill + ), R.assoc( `cash-cassette-${i}-empty`, <> - Cash-out {i} emptied + + Cash cassette {i} emptied + ) )(ret), @@ -111,7 +115,7 @@ const CashboxHistory = ({ machines, currency }) => { 'cash-box-empty': ( <> - Cash-in emptied + Cash box emptied ) }, @@ -254,7 +258,7 @@ const CashboxHistory = ({ machines, currency }) => { name="cashboxHistory" elements={elements} data={batches} - emptyText="No cashbox batches so far" + emptyText="No cash box batches so far" /> )} diff --git a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.js b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.js index a5cb66ff..56fae668 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.js +++ b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardSplash.js @@ -67,7 +67,7 @@ const WizardSplash = ({ name, onContinue }) => {

- For cash-out cassettes, please make sure you've removed the remaining + For cash cassettes, please make sure you've removed the remaining bills before adding the new ones.

diff --git a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js index d28081c5..bb84c639 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js +++ b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js @@ -168,7 +168,7 @@ const WizardStep = ({ classes.verticalAlign, classes.fullWidth )}> -

Did you empty the cash-in box?

+

Did you empty the cash box?

Since previous update

- Number of bills inside the cashbox, since the last - cashbox changes. + Number of bills inside the cash box, since the last + cash box changes.

@@ -255,7 +255,7 @@ const WizardStep = ({

- Cash-out {step - 1} (dispenser) + Cash cassette {step - 1} (dispenser)

{ it => { elements.push({ name: `fillingPercentageCassette${it}`, - display: `Cash-out ${it}`, + display: `Cash cassette ${it}`, width: 155, textAlign: 'right', - doubleHeader: 'Cash-out (Cassette Empty)', + doubleHeader: 'Cash Cassette Empty', bold: true, input: NumberInput, suffix: '%', From 464b3e278afdeba02c321c9a030bd5c7ecdc9c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Wed, 22 Dec 2021 11:20:43 +0000 Subject: [PATCH 4/5] refactor: rename 'Cashbox' to 'Cash box' in the batches module --- lib/cashbox-batches.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js index dfc9d2a6..3375158e 100644 --- a/lib/cashbox-batches.js +++ b/lib/cashbox-batches.js @@ -4,7 +4,7 @@ const _ = require('lodash/fp') const uuid = require('uuid') function createCashboxBatch (deviceId, cashboxCount) { - if (_.isEqual(0, cashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created.') + if (_.isEqual(0, cashboxCount)) throw new Error('Cash box is empty. Cash box batch could not be created.') const sql = `INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-box-empty') RETURNING *` const sql2 = ` UPDATE bills SET cashbox_batch_id=$1 @@ -24,7 +24,7 @@ function updateMachineWithBatch (machineContext, oldCashboxCount) { const isCassetteAmountWithinRange = _.inRange(constants.CASH_OUT_MINIMUM_AMOUNT_OF_CASSETTES, constants.CASH_OUT_MAXIMUM_AMOUNT_OF_CASSETTES + 1, _.size(machineContext.cassettes)) if (!isValidContext && !isCassetteAmountWithinRange) throw new Error('Insufficient info to create a new cashbox batch') - if (_.isEqual(0, oldCashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created.') + if (_.isEqual(0, oldCashboxCount)) throw new Error('Cash box is empty. Cash box batch could not be created.') return db.tx(t => { const deviceId = machineContext.deviceId From 3fc64955b930458fda9d9756abb9bacf3bce8372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Wed, 22 Dec 2021 11:23:39 +0000 Subject: [PATCH 5/5] refactor: change automatic/manual batch creation option menu text --- .../src/pages/Maintenance/CashCassettes.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/new-lamassu-admin/src/pages/Maintenance/CashCassettes.js b/new-lamassu-admin/src/pages/Maintenance/CashCassettes.js index 716aa227..329d0adc 100644 --- a/new-lamassu-admin/src/pages/Maintenance/CashCassettes.js +++ b/new-lamassu-admin/src/pages/Maintenance/CashCassettes.js @@ -281,7 +281,7 @@ const CashCassettes = () => { className={classes.tableWidth}> {!showHistory && ( - Cashbox reset + Cash box resets { )} {editingSchema && ( setEditingSchema(null)} open={true}>

- Specify if you want your cash-in counts to be reset automatically or - manually. + We can automatically assume you emptied a bill validator's cash box + when the machine detects that it has been removed.

{ className={classes.radioButtons} />

- Choose this option if you want your cash-in cashbox count to be - reset automatically when it is physically removed from the machine. + Assume the cash box is emptied whenever it's removed, creating a new + batch on the history screen and setting its current balance to zero.

{ className={classes.radioButtons} />

- Choose this option if you want to edit your cash-in counts manually - on Lamassu Admin, after you physically remove the bills from the - cashbox. + Cash boxes won't be assumed emptied when removed, nor their counts + modified. Instead, to update the count and create a new batch, + you'll click the 'Edit' button on this panel.