feat: add cash-out fixed fee to Admin UI
This commit is contained in:
parent
5b55ce89d8
commit
d6d7753e07
3 changed files with 76 additions and 7 deletions
|
|
@ -156,6 +156,20 @@ const getOverridesFields = (getData, currency, auxElements) => {
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cashOutFixedFee',
|
||||||
|
display: 'Fixed fee',
|
||||||
|
width: 144,
|
||||||
|
doubleHeader: 'Cash-out only',
|
||||||
|
textAlign: 'center',
|
||||||
|
editingAlign: 'right',
|
||||||
|
input: NumberInput,
|
||||||
|
suffix: currency,
|
||||||
|
bold: bold,
|
||||||
|
inputProps: {
|
||||||
|
decimalPlaces: 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -218,6 +232,20 @@ const mainFields = currency => [
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cashOutFixedFee',
|
||||||
|
display: 'Fixed fee',
|
||||||
|
width: 169,
|
||||||
|
doubleHeader: 'Cash-out only',
|
||||||
|
textAlign: 'center',
|
||||||
|
editingAlign: 'right',
|
||||||
|
input: NumberInput,
|
||||||
|
suffix: currency,
|
||||||
|
bold: bold,
|
||||||
|
inputProps: {
|
||||||
|
decimalPlaces: 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -245,7 +273,7 @@ const getSchema = locale => {
|
||||||
.max(percentMax)
|
.max(percentMax)
|
||||||
.required(),
|
.required(),
|
||||||
fixedFee: Yup.number()
|
fixedFee: Yup.number()
|
||||||
.label('Fixed fee')
|
.label('Cash-in fixed fee')
|
||||||
.min(0)
|
.min(0)
|
||||||
.max(highestBill)
|
.max(highestBill)
|
||||||
.required(),
|
.required(),
|
||||||
|
|
@ -253,6 +281,11 @@ const getSchema = locale => {
|
||||||
.label('Minimum Tx')
|
.label('Minimum Tx')
|
||||||
.min(0)
|
.min(0)
|
||||||
.max(highestBill)
|
.max(highestBill)
|
||||||
|
.required(),
|
||||||
|
cashOutFixedFee: Yup.number()
|
||||||
|
.label('Cash-out fixed fee')
|
||||||
|
.min(0)
|
||||||
|
.max(highestBill)
|
||||||
.required()
|
.required()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -340,7 +373,7 @@ const getOverridesSchema = (values, rawData, locale) => {
|
||||||
.max(percentMax)
|
.max(percentMax)
|
||||||
.required(),
|
.required(),
|
||||||
fixedFee: Yup.number()
|
fixedFee: Yup.number()
|
||||||
.label('Fixed fee')
|
.label('Cash-in fixed fee')
|
||||||
.min(0)
|
.min(0)
|
||||||
.max(highestBill)
|
.max(highestBill)
|
||||||
.required(),
|
.required(),
|
||||||
|
|
@ -348,6 +381,11 @@ const getOverridesSchema = (values, rawData, locale) => {
|
||||||
.label('Minimum Tx')
|
.label('Minimum Tx')
|
||||||
.min(0)
|
.min(0)
|
||||||
.max(highestBill)
|
.max(highestBill)
|
||||||
|
.required(),
|
||||||
|
cashOutFixedFee: Yup.number()
|
||||||
|
.label('Cash-out fixed fee')
|
||||||
|
.min(0)
|
||||||
|
.max(highestBill)
|
||||||
.required()
|
.required()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -356,7 +394,8 @@ const defaults = {
|
||||||
cashIn: '',
|
cashIn: '',
|
||||||
cashOut: '',
|
cashOut: '',
|
||||||
fixedFee: '',
|
fixedFee: '',
|
||||||
minimumTx: ''
|
minimumTx: '',
|
||||||
|
cashOutFixedFee: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const overridesDefaults = {
|
const overridesDefaults = {
|
||||||
|
|
@ -365,7 +404,8 @@ const overridesDefaults = {
|
||||||
cashIn: '',
|
cashIn: '',
|
||||||
cashOut: '',
|
cashOut: '',
|
||||||
fixedFee: '',
|
fixedFee: '',
|
||||||
minimumTx: ''
|
minimumTx: '',
|
||||||
|
cashOutFixedFee: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOrder = ({ machine, cryptoCurrencies }) => {
|
const getOrder = ({ machine, cryptoCurrencies }) => {
|
||||||
|
|
@ -385,6 +425,7 @@ const createCommissions = (cryptoCode, deviceId, isDefault, config) => {
|
||||||
fixedFee: config.fixedFee,
|
fixedFee: config.fixedFee,
|
||||||
cashOut: config.cashOut,
|
cashOut: config.cashOut,
|
||||||
cashIn: config.cashIn,
|
cashIn: config.cashIn,
|
||||||
|
cashOutFixedFee: config.cashOutFixedFee,
|
||||||
machine: deviceId,
|
machine: deviceId,
|
||||||
cryptoCurrencies: [cryptoCode],
|
cryptoCurrencies: [cryptoCode],
|
||||||
default: isDefault,
|
default: isDefault,
|
||||||
|
|
@ -451,7 +492,7 @@ const getListCommissionsSchema = locale => {
|
||||||
.max(percentMax)
|
.max(percentMax)
|
||||||
.required(),
|
.required(),
|
||||||
fixedFee: Yup.number()
|
fixedFee: Yup.number()
|
||||||
.label('Fixed fee')
|
.label('Cash-in fixed fee')
|
||||||
.min(0)
|
.min(0)
|
||||||
.max(highestBill)
|
.max(highestBill)
|
||||||
.required(),
|
.required(),
|
||||||
|
|
@ -459,6 +500,11 @@ const getListCommissionsSchema = locale => {
|
||||||
.label('Minimum Tx')
|
.label('Minimum Tx')
|
||||||
.min(0)
|
.min(0)
|
||||||
.max(highestBill)
|
.max(highestBill)
|
||||||
|
.required(),
|
||||||
|
cashOutFixedFee: Yup.number()
|
||||||
|
.label('Cash-out fixed fee')
|
||||||
|
.min(0)
|
||||||
|
.max(highestBill)
|
||||||
.required()
|
.required()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -544,6 +590,20 @@ const getListCommissionsFields = (getData, currency, defaults) => {
|
||||||
inputProps: {
|
inputProps: {
|
||||||
decimalPlaces: 2
|
decimalPlaces: 2
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cashOutFixedFee',
|
||||||
|
display: 'Fixed fee',
|
||||||
|
width: 144,
|
||||||
|
doubleHeader: 'Cash-out only',
|
||||||
|
textAlign: 'center',
|
||||||
|
editingAlign: 'right',
|
||||||
|
input: NumberInput,
|
||||||
|
suffix: currency,
|
||||||
|
bold: bold,
|
||||||
|
inputProps: {
|
||||||
|
decimalPlaces: 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,11 @@ const Commissions = ({ name: SCREEN_KEY, id: deviceId }) => {
|
||||||
cashIn: config.cashIn,
|
cashIn: config.cashIn,
|
||||||
cashOut: config.cashOut,
|
cashOut: config.cashOut,
|
||||||
fixedFee: config.fixedFee,
|
fixedFee: config.fixedFee,
|
||||||
minimumTx: config.minimumTx
|
minimumTx: config.minimumTx,
|
||||||
|
cashOutFixedFee: config.cashOutFixedFee
|
||||||
},
|
},
|
||||||
R.project(
|
R.project(
|
||||||
['cashIn', 'cashOut', 'fixedFee', 'minimumTx'],
|
['cashIn', 'cashOut', 'fixedFee', 'minimumTx', 'cashOutFixedFee'],
|
||||||
R.filter(
|
R.filter(
|
||||||
o =>
|
o =>
|
||||||
R.includes(coin.code, o.cryptoCurrencies) ||
|
R.includes(coin.code, o.cryptoCurrencies) ||
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,14 @@ const getOverridesFields = currency => {
|
||||||
doubleHeader: 'Cash-in only',
|
doubleHeader: 'Cash-in only',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
suffix: currency
|
suffix: currency
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cashOutFixedFee',
|
||||||
|
display: 'Fixed fee',
|
||||||
|
width: 155,
|
||||||
|
doubleHeader: 'Cash-out only',
|
||||||
|
textAlign: 'right',
|
||||||
|
suffix: currency
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue