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,
|
greatest(0, date_part('day', c.suspended_until - now())) AS days_suspended,
|
||||||
c.suspended_until > now() AS is_suspended,
|
c.suspended_until > now() AS is_suspended,
|
||||||
c.front_camera_path, c.front_camera_override, c.front_camera_at,
|
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.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,
|
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,
|
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 = [
|
const cards = [
|
||||||
{
|
{
|
||||||
fields: customerDataElements.idCardData,
|
fields: customerDataElements.idCardData,
|
||||||
|
|
@ -161,7 +178,7 @@ const CustomerData = ({
|
||||||
isAvailable: !R.isNil(idData)
|
isAvailable: !R.isNil(idData)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fields: customerDataElements.smsData,
|
fields: smsDataElements,
|
||||||
title: 'SMS data',
|
title: 'SMS data',
|
||||||
titleIcon: <PhoneIcon className={classes.cardIcon} />,
|
titleIcon: <PhoneIcon className={classes.cardIcon} />,
|
||||||
state: R.path(['phoneOverride'])(customer),
|
state: R.path(['phoneOverride'])(customer),
|
||||||
|
|
@ -175,7 +192,7 @@ const CustomerData = ({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
validationSchema: customerDataSchemas.smsData,
|
validationSchema: smsDataSchema.smsData,
|
||||||
retrieveAdditionalData: () => setRetrieve(true),
|
retrieveAdditionalData: () => setRetrieve(true),
|
||||||
initialValues: initialValues.smsData,
|
initialValues: initialValues.smsData,
|
||||||
isAvailable: !R.isNil(phone),
|
isAvailable: !R.isNil(phone),
|
||||||
|
|
@ -347,18 +364,18 @@ const CustomerData = ({
|
||||||
|
|
||||||
R.forEach(it => {
|
R.forEach(it => {
|
||||||
initialValues.smsData[it] = smsData[it]
|
initialValues.smsData[it] = smsData[it]
|
||||||
customerDataElements.smsData.push({
|
smsDataElements.push({
|
||||||
name: it,
|
name: it,
|
||||||
label: onlyFirstToUpper(it),
|
label: onlyFirstToUpper(it),
|
||||||
component: TextInput,
|
component: TextInput,
|
||||||
editable: true
|
editable: true
|
||||||
})
|
})
|
||||||
customerDataSchemas.smsData = Yup.object()
|
smsDataSchema.smsData = Yup.object()
|
||||||
.shape({
|
.shape({
|
||||||
[it]: Yup.string()
|
[it]: Yup.string()
|
||||||
})
|
})
|
||||||
.required()
|
.required()
|
||||||
.concat(customerDataSchemas.smsData)
|
.concat(smsDataSchema.smsData)
|
||||||
}, R.keys(smsData) ?? [])
|
}, R.keys(smsData) ?? [])
|
||||||
|
|
||||||
const editableCard = (
|
const editableCard = (
|
||||||
|
|
|
||||||
|
|
@ -591,22 +591,6 @@ const CustomerProfile = memo(() => {
|
||||||
{`Test user`}
|
{`Test user`}
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -274,13 +274,15 @@ const EditableCard = ({
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ActionButton
|
{hasAdditionalData && (
|
||||||
color="primary"
|
<ActionButton
|
||||||
Icon={EditIcon}
|
color="primary"
|
||||||
InverseIcon={EditReversedIcon}
|
Icon={EditIcon}
|
||||||
onClick={() => setEditing(true)}>
|
InverseIcon={EditReversedIcon}
|
||||||
Edit
|
onClick={() => setEditing(true)}>
|
||||||
</ActionButton>
|
Edit
|
||||||
|
</ActionButton>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{editing && (
|
{editing && (
|
||||||
|
|
|
||||||
|
|
@ -405,13 +405,7 @@ const customerDataElements = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
idCardPhoto: [{ name: 'idCardPhoto' }],
|
idCardPhoto: [{ name: 'idCardPhoto' }],
|
||||||
frontCamera: [{ name: 'frontCamera' }],
|
frontCamera: [{ name: 'frontCamera' }]
|
||||||
smsData: {
|
|
||||||
name: 'phoneNumber',
|
|
||||||
label: 'Phone number',
|
|
||||||
component: TextInput,
|
|
||||||
editable: false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const customerDataSchemas = {
|
const customerDataSchemas = {
|
||||||
|
|
@ -440,12 +434,7 @@ const customerDataSchemas = {
|
||||||
}),
|
}),
|
||||||
frontCamera: Yup.object().shape({
|
frontCamera: Yup.object().shape({
|
||||||
frontCamera: Yup.mixed().required()
|
frontCamera: Yup.mixed().required()
|
||||||
}),
|
})
|
||||||
smsData: Yup.object()
|
|
||||||
.shape({
|
|
||||||
phoneNumber: Yup.string().required()
|
|
||||||
})
|
|
||||||
.required()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const requirementElements = {
|
const requirementElements = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue