fix: merge conflicts leftovers and query
This commit is contained in:
parent
68bf2e8315
commit
1e86e830c7
5 changed files with 34 additions and 42 deletions
|
|
@ -700,7 +700,7 @@ function getCustomerById (id) {
|
|||
greatest(0, date_part('day', c.suspended_until - now())) AS days_suspended,
|
||||
c.suspended_until > now() AS is_suspended,
|
||||
c.front_camera_path, c.front_camera_override, c.front_camera_at,
|
||||
c.phone, c.phone_at, c.sms_override, c.id_card_data, c.id_card_data_at, c.id_card_data_override, c.id_card_data_expiration,
|
||||
c.phone, c.phone_at, c.phone_override, c.sms_override, c.id_card_data, c.id_card_data_at, c.id_card_data_override, c.id_card_data_expiration,
|
||||
c.id_card_photo_path, c.id_card_photo_at, c.id_card_photo_override, c.us_ssn, c.us_ssn_at, c.us_ssn_override, c.sanctions,
|
||||
c.sanctions_at, c.sanctions_override, c.subscriber_info, c.subscriber_info_at, c.is_test_customer, c.created, t.tx_class, t.fiat, t.fiat_code, t.created as last_transaction, cn.notes,
|
||||
row_number() OVER (PARTITION BY c.id ORDER BY t.created DESC) AS rn,
|
||||
|
|
|
|||
|
|
@ -142,6 +142,23 @@ const CustomerData = ({
|
|||
}
|
||||
}
|
||||
|
||||
const smsDataElements = [
|
||||
{
|
||||
name: 'phoneNumber',
|
||||
label: 'Phone number',
|
||||
component: TextInput,
|
||||
editable: false
|
||||
}
|
||||
]
|
||||
|
||||
const smsDataSchema = {
|
||||
smsData: Yup.object()
|
||||
.shape({
|
||||
phoneNumber: Yup.string().required()
|
||||
})
|
||||
.required()
|
||||
}
|
||||
|
||||
const cards = [
|
||||
{
|
||||
fields: customerDataElements.idCardData,
|
||||
|
|
@ -161,7 +178,7 @@ const CustomerData = ({
|
|||
isAvailable: !R.isNil(idData)
|
||||
},
|
||||
{
|
||||
fields: customerDataElements.smsData,
|
||||
fields: smsDataElements,
|
||||
title: 'SMS data',
|
||||
titleIcon: <PhoneIcon className={classes.cardIcon} />,
|
||||
state: R.path(['phoneOverride'])(customer),
|
||||
|
|
@ -175,7 +192,7 @@ const CustomerData = ({
|
|||
}
|
||||
})
|
||||
},
|
||||
validationSchema: customerDataSchemas.smsData,
|
||||
validationSchema: smsDataSchema.smsData,
|
||||
retrieveAdditionalData: () => setRetrieve(true),
|
||||
initialValues: initialValues.smsData,
|
||||
isAvailable: !R.isNil(phone),
|
||||
|
|
@ -347,18 +364,18 @@ const CustomerData = ({
|
|||
|
||||
R.forEach(it => {
|
||||
initialValues.smsData[it] = smsData[it]
|
||||
customerDataElements.smsData.push({
|
||||
smsDataElements.push({
|
||||
name: it,
|
||||
label: onlyFirstToUpper(it),
|
||||
component: TextInput,
|
||||
editable: true
|
||||
})
|
||||
customerDataSchemas.smsData = Yup.object()
|
||||
smsDataSchema.smsData = Yup.object()
|
||||
.shape({
|
||||
[it]: Yup.string()
|
||||
})
|
||||
.required()
|
||||
.concat(customerDataSchemas.smsData)
|
||||
.concat(smsDataSchema.smsData)
|
||||
}, R.keys(smsData) ?? [])
|
||||
|
||||
const editableCard = (
|
||||
|
|
|
|||
|
|
@ -591,22 +591,6 @@ const CustomerProfile = memo(() => {
|
|||
{`Test user`}
|
||||
</div>
|
||||
</div>
|
||||
<ActionButton
|
||||
color="primary"
|
||||
className={classes.actionButton}
|
||||
Icon={blocked ? AuthorizeIcon : BlockIcon}
|
||||
InverseIcon={
|
||||
blocked ? AuthorizeReversedIcon : BlockReversedIcon
|
||||
}
|
||||
onClick={() =>
|
||||
updateCustomer({
|
||||
authorizedOverride: blocked
|
||||
? OVERRIDE_AUTHORIZED
|
||||
: OVERRIDE_REJECTED
|
||||
})
|
||||
}>
|
||||
{`${blocked ? 'Authorize' : 'Block'} customer`}
|
||||
</ActionButton>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@ const EditableCard = ({
|
|||
</ActionButton>
|
||||
)}
|
||||
</div>
|
||||
{hasAdditionalData && (
|
||||
<ActionButton
|
||||
color="primary"
|
||||
Icon={EditIcon}
|
||||
|
|
@ -281,6 +282,7 @@ const EditableCard = ({
|
|||
onClick={() => setEditing(true)}>
|
||||
Edit
|
||||
</ActionButton>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{editing && (
|
||||
|
|
|
|||
|
|
@ -405,13 +405,7 @@ const customerDataElements = {
|
|||
}
|
||||
],
|
||||
idCardPhoto: [{ name: 'idCardPhoto' }],
|
||||
frontCamera: [{ name: 'frontCamera' }],
|
||||
smsData: {
|
||||
name: 'phoneNumber',
|
||||
label: 'Phone number',
|
||||
component: TextInput,
|
||||
editable: false
|
||||
}
|
||||
frontCamera: [{ name: 'frontCamera' }]
|
||||
}
|
||||
|
||||
const customerDataSchemas = {
|
||||
|
|
@ -440,12 +434,7 @@ const customerDataSchemas = {
|
|||
}),
|
||||
frontCamera: Yup.object().shape({
|
||||
frontCamera: Yup.mixed().required()
|
||||
}),
|
||||
smsData: Yup.object()
|
||||
.shape({
|
||||
phoneNumber: Yup.string().required()
|
||||
})
|
||||
.required()
|
||||
}
|
||||
|
||||
const requirementElements = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue