diff --git a/new-lamassu-admin/src/pages/Customers/CustomerData.js b/new-lamassu-admin/src/pages/Customers/CustomerData.js
index 3e1ba8fa..27e0e443 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerData.js
+++ b/new-lamassu-admin/src/pages/Customers/CustomerData.js
@@ -29,7 +29,8 @@ import { EditableCard } from './components'
import {
customerDataElements,
customerDataSchemas,
- formatDates
+ formatDates,
+ getFormattedPhone
} from './helper.js'
const useStyles = makeStyles(styles)
@@ -62,6 +63,7 @@ const Photo = ({ show, src }) => {
}
const CustomerData = ({
+ locale,
customer,
updateCustomer,
replacePhoto,
@@ -96,6 +98,9 @@ const CustomerData = ({
R.path(['customInfoRequests'])(customer) ?? []
)
+ const phone = R.path(['phone'])(customer)
+ const smsData = R.path(['subscriberInfo'])(customer)
+
const isEven = elem => elem % 2 === 0
const getVisibleCards = _.filter(elem => elem.isAvailable)
@@ -126,6 +131,9 @@ const CustomerData = ({
},
idCardPhoto: {
idCardPhoto: null
+ },
+ smsData: {
+ phoneNumber: getFormattedPhone(phone, locale.country)
}
}
@@ -148,12 +156,16 @@ const CustomerData = ({
isAvailable: !_.isNil(idData)
},
{
- title: 'SMS Confirmation',
+ fields: customerDataElements.smsData,
+ title: 'SMS data',
titleIcon: ,
authorize: () => {},
reject: () => {},
save: () => {},
- isAvailable: false
+ validationSchema: customerDataSchemas.smsData,
+ initialValues: initialValues.smsData,
+ isAvailable: !_.isNil(phone),
+ isDeletable: !_.isNil(smsData) || !_.isEmpty(smsData.result)
},
{
title: 'Name',
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js
index 5a0d2314..9c38bdfa 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js
+++ b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js
@@ -69,6 +69,7 @@ const GET_CUSTOMER = gql`
daysSuspended
isSuspended
isTestCustomer
+ subscriberInfo
customFields {
id
label
@@ -628,6 +629,7 @@ const CustomerProfile = memo(() => {
{isCustomerData && (
{
const classes = useStyles()
diff --git a/new-lamassu-admin/src/pages/Customers/helper.js b/new-lamassu-admin/src/pages/Customers/helper.js
index 9c980a33..990b091e 100644
--- a/new-lamassu-admin/src/pages/Customers/helper.js
+++ b/new-lamassu-admin/src/pages/Customers/helper.js
@@ -397,7 +397,12 @@ const customerDataElements = {
}
],
idCardPhoto: [{ name: 'idCardPhoto' }],
- frontCamera: [{ name: 'frontCamera' }]
+ frontCamera: [{ name: 'frontCamera' }],
+ smsData: {
+ name: 'phoneNumber',
+ label: 'Phone number',
+ component: TextInput
+ }
}
const customerDataSchemas = {
@@ -426,6 +431,9 @@ const customerDataSchemas = {
}),
frontCamera: Yup.object().shape({
frontCamera: Yup.mixed().required()
+ }),
+ smsData: Yup.object().shape({
+ phoneNumber: Yup.mixed().required()
})
}