fix: rename phone override fields
This commit is contained in:
parent
23a892061c
commit
aad3826d02
5 changed files with 12 additions and 14 deletions
|
|
@ -122,7 +122,7 @@ async function updateCustomer (id, data, userToken) {
|
||||||
'sanctions_override',
|
'sanctions_override',
|
||||||
'front_camera_override',
|
'front_camera_override',
|
||||||
'suspended_until',
|
'suspended_until',
|
||||||
'subscriber_info_override'
|
'phone_override'
|
||||||
],
|
],
|
||||||
_.mapKeys(_.snakeCase, data))
|
_.mapKeys(_.snakeCase, data))
|
||||||
|
|
||||||
|
|
@ -694,7 +694,7 @@ function getCustomerById (id) {
|
||||||
phone, phone_at, sms_override, id_card_data_at, id_card_data, id_card_data_override, id_card_data_expiration,
|
phone, phone_at, sms_override, id_card_data_at, id_card_data, id_card_data_override, id_card_data_expiration,
|
||||||
id_card_photo_path, id_card_photo_at, id_card_photo_override, us_ssn_at, us_ssn, us_ssn_override, sanctions, sanctions_at,
|
id_card_photo_path, id_card_photo_at, id_card_photo_override, us_ssn_at, us_ssn, us_ssn_override, sanctions, sanctions_at,
|
||||||
sanctions_override, total_txs, total_spent, LEAST(created, last_transaction) AS last_active, fiat AS last_tx_fiat,
|
sanctions_override, total_txs, total_spent, LEAST(created, last_transaction) AS last_active, fiat AS last_tx_fiat,
|
||||||
fiat_code AS last_tx_fiat_code, tx_class AS last_tx_class, subscriber_info, subscriber_info_at, subscriber_info_override, custom_fields, notes, is_test_customer
|
fiat_code AS last_tx_fiat_code, tx_class AS last_tx_class, subscriber_info, subscriber_info_at, phone_override, custom_fields, notes, is_test_customer
|
||||||
FROM (
|
FROM (
|
||||||
SELECT c.id, c.authorized_override,
|
SELECT c.id, c.authorized_override,
|
||||||
greatest(0, date_part('day', c.suspended_until - now())) AS days_suspended,
|
greatest(0, date_part('day', c.suspended_until - now())) AS days_suspended,
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ const typeDef = gql`
|
||||||
lastTxClass: String
|
lastTxClass: String
|
||||||
transactions: [Transaction]
|
transactions: [Transaction]
|
||||||
subscriberInfo: JSONObject
|
subscriberInfo: JSONObject
|
||||||
subscriberInfoOverride: String
|
phoneOverride: String
|
||||||
customFields: [CustomerCustomField]
|
customFields: [CustomerCustomField]
|
||||||
customInfoRequests: [CustomRequestData]
|
customInfoRequests: [CustomRequestData]
|
||||||
notes: [CustomerNote]
|
notes: [CustomerNote]
|
||||||
|
|
@ -64,7 +64,7 @@ const typeDef = gql`
|
||||||
lastTxClass: String
|
lastTxClass: String
|
||||||
suspendedUntil: Date
|
suspendedUntil: Date
|
||||||
subscriberInfo: Boolean
|
subscriberInfo: Boolean
|
||||||
subscriberInfoOverride: String
|
phoneOverride: String
|
||||||
}
|
}
|
||||||
|
|
||||||
input CustomerEdit {
|
input CustomerEdit {
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ var db = require('./db')
|
||||||
exports.up = function (next) {
|
exports.up = function (next) {
|
||||||
var sql = [
|
var sql = [
|
||||||
`ALTER TABLE customers
|
`ALTER TABLE customers
|
||||||
ADD COLUMN subscriber_info_override VERIFICATION_TYPE NOT NULL DEFAULT 'automatic',
|
ADD COLUMN phone_override VERIFICATION_TYPE NOT NULL DEFAULT 'automatic',
|
||||||
ADD COLUMN subscriber_info_override_by UUID,
|
ADD COLUMN phone_override_by UUID,
|
||||||
ADD COLUMN subscriber_info_override_at TIMESTAMPTZ
|
ADD COLUMN phone_override_at TIMESTAMPTZ
|
||||||
`,
|
`,
|
||||||
`ALTER TABLE edited_customer_data
|
`ALTER TABLE edited_customer_data
|
||||||
ADD COLUMN phone TEXT,
|
ADD COLUMN phone TEXT,
|
||||||
|
|
|
||||||
|
|
@ -164,11 +164,9 @@ const CustomerData = ({
|
||||||
fields: customerDataElements.smsData,
|
fields: customerDataElements.smsData,
|
||||||
title: 'SMS data',
|
title: 'SMS data',
|
||||||
titleIcon: <PhoneIcon className={classes.cardIcon} />,
|
titleIcon: <PhoneIcon className={classes.cardIcon} />,
|
||||||
state: R.path(['subscriberInfoOverride'])(customer),
|
state: R.path(['phoneOverride'])(customer),
|
||||||
authorize: () =>
|
authorize: () => updateCustomer({ phoneOverride: OVERRIDE_AUTHORIZED }),
|
||||||
updateCustomer({ subscriberInfoOverride: OVERRIDE_AUTHORIZED }),
|
reject: () => updateCustomer({ phoneOverride: OVERRIDE_REJECTED }),
|
||||||
reject: () =>
|
|
||||||
updateCustomer({ subscriberInfoOverride: OVERRIDE_REJECTED }),
|
|
||||||
save: values => {
|
save: values => {
|
||||||
editCustomer({
|
editCustomer({
|
||||||
phone: parsePhoneNumber(values.phoneNumber).number,
|
phone: parsePhoneNumber(values.phoneNumber).number,
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ const GET_CUSTOMER = gql`
|
||||||
isSuspended
|
isSuspended
|
||||||
isTestCustomer
|
isTestCustomer
|
||||||
subscriberInfo
|
subscriberInfo
|
||||||
subscriberInfoOverride
|
phoneOverride
|
||||||
customFields {
|
customFields {
|
||||||
id
|
id
|
||||||
label
|
label
|
||||||
|
|
@ -140,7 +140,7 @@ const SET_CUSTOMER = gql`
|
||||||
lastTxFiatCode
|
lastTxFiatCode
|
||||||
lastTxClass
|
lastTxClass
|
||||||
subscriberInfo
|
subscriberInfo
|
||||||
subscriberInfoOverride
|
phoneOverride
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue