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',
|
||||
'front_camera_override',
|
||||
'suspended_until',
|
||||
'subscriber_info_override'
|
||||
'phone_override'
|
||||
],
|
||||
_.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,
|
||||
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,
|
||||
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 (
|
||||
SELECT c.id, c.authorized_override,
|
||||
greatest(0, date_part('day', c.suspended_until - now())) AS days_suspended,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const typeDef = gql`
|
|||
lastTxClass: String
|
||||
transactions: [Transaction]
|
||||
subscriberInfo: JSONObject
|
||||
subscriberInfoOverride: String
|
||||
phoneOverride: String
|
||||
customFields: [CustomerCustomField]
|
||||
customInfoRequests: [CustomRequestData]
|
||||
notes: [CustomerNote]
|
||||
|
|
@ -64,7 +64,7 @@ const typeDef = gql`
|
|||
lastTxClass: String
|
||||
suspendedUntil: Date
|
||||
subscriberInfo: Boolean
|
||||
subscriberInfoOverride: String
|
||||
phoneOverride: String
|
||||
}
|
||||
|
||||
input CustomerEdit {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ var db = require('./db')
|
|||
exports.up = function (next) {
|
||||
var sql = [
|
||||
`ALTER TABLE customers
|
||||
ADD COLUMN subscriber_info_override VERIFICATION_TYPE NOT NULL DEFAULT 'automatic',
|
||||
ADD COLUMN subscriber_info_override_by UUID,
|
||||
ADD COLUMN subscriber_info_override_at TIMESTAMPTZ
|
||||
ADD COLUMN phone_override VERIFICATION_TYPE NOT NULL DEFAULT 'automatic',
|
||||
ADD COLUMN phone_override_by UUID,
|
||||
ADD COLUMN phone_override_at TIMESTAMPTZ
|
||||
`,
|
||||
`ALTER TABLE edited_customer_data
|
||||
ADD COLUMN phone TEXT,
|
||||
|
|
|
|||
|
|
@ -164,11 +164,9 @@ const CustomerData = ({
|
|||
fields: customerDataElements.smsData,
|
||||
title: 'SMS data',
|
||||
titleIcon: <PhoneIcon className={classes.cardIcon} />,
|
||||
state: R.path(['subscriberInfoOverride'])(customer),
|
||||
authorize: () =>
|
||||
updateCustomer({ subscriberInfoOverride: OVERRIDE_AUTHORIZED }),
|
||||
reject: () =>
|
||||
updateCustomer({ subscriberInfoOverride: OVERRIDE_REJECTED }),
|
||||
state: R.path(['phoneOverride'])(customer),
|
||||
authorize: () => updateCustomer({ phoneOverride: OVERRIDE_AUTHORIZED }),
|
||||
reject: () => updateCustomer({ phoneOverride: OVERRIDE_REJECTED }),
|
||||
save: values => {
|
||||
editCustomer({
|
||||
phone: parsePhoneNumber(values.phoneNumber).number,
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ const GET_CUSTOMER = gql`
|
|||
isSuspended
|
||||
isTestCustomer
|
||||
subscriberInfo
|
||||
subscriberInfoOverride
|
||||
phoneOverride
|
||||
customFields {
|
||||
id
|
||||
label
|
||||
|
|
@ -140,7 +140,7 @@ const SET_CUSTOMER = gql`
|
|||
lastTxFiatCode
|
||||
lastTxClass
|
||||
subscriberInfo
|
||||
subscriberInfoOverride
|
||||
phoneOverride
|
||||
}
|
||||
}
|
||||
`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue