Merge pull request #1726 from lamassu/release-10.0

Release 10.0
This commit is contained in:
Rafael Taranto 2024-10-14 18:32:52 +01:00 committed by GitHub
commit 8b6071270a
4 changed files with 21 additions and 19 deletions

View file

@ -1,6 +1,5 @@
import Grid from '@material-ui/core/Grid' import Grid from '@material-ui/core/Grid'
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import { parse, format } from 'date-fns/fp'
import * as R from 'ramda' import * as R from 'ramda'
import { useState, React } from 'react' import { useState, React } from 'react'
import * as Yup from 'yup' import * as Yup from 'yup'
@ -30,6 +29,7 @@ import {
customerDataElements, customerDataElements,
customerDataSchemas, customerDataSchemas,
formatDates, formatDates,
tryFormatDate,
getFormattedPhone getFormattedPhone
} from './helper.js' } from './helper.js'
@ -113,18 +113,10 @@ const CustomerData = ({
firstName: R.path(['firstName'])(idData) ?? '', firstName: R.path(['firstName'])(idData) ?? '',
lastName: R.path(['lastName'])(idData) ?? '', lastName: R.path(['lastName'])(idData) ?? '',
documentNumber: R.path(['documentNumber'])(idData) ?? '', documentNumber: R.path(['documentNumber'])(idData) ?? '',
dateOfBirth: dateOfBirth: tryFormatDate(rawDob),
(rawDob &&
format('yyyy-MM-dd')(parse(new Date(), 'yyyyMMdd', rawDob))) ??
'',
gender: R.path(['gender'])(idData) ?? '', gender: R.path(['gender'])(idData) ?? '',
country: R.path(['country'])(idData) ?? '', country: R.path(['country'])(idData) ?? '',
expirationDate: expirationDate: tryFormatDate(rawExpirationDate)
(rawExpirationDate &&
format('yyyy-MM-dd')(
parse(new Date(), 'yyyyMMdd', rawExpirationDate)
)) ??
''
}, },
usSsn: { usSsn: {
usSsn: customer.usSsn ?? '' usSsn: customer.usSsn ?? ''

View file

@ -528,13 +528,22 @@ const requirementElements = {
} }
} }
const tryFormatDate = rawDate => {
try {
return (
(rawDate &&
format('yyyy-MM-dd')(parse(new Date(), 'yyyyMMdd', rawDate))) ??
''
)
} catch (err) {
return ''
}
}
const formatDates = values => { const formatDates = values => {
R.map( R.forEach(elem => {
elem => values[elem] = tryFormatDate(values[elem])
(values[elem] = format('yyyyMMdd')( })(['dateOfBirth', 'expirationDate'])
parse(new Date(), 'yyyy-MM-dd', values[elem])
))
)(['dateOfBirth', 'expirationDate'])
return values return values
} }
@ -579,6 +588,7 @@ export {
customerDataElements, customerDataElements,
customerDataSchemas, customerDataSchemas,
formatDates, formatDates,
tryFormatDate,
REQUIREMENT, REQUIREMENT,
CUSTOM, CUSTOM,
ID_CARD_DATA ID_CARD_DATA

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "lamassu-server", "name": "lamassu-server",
"version": "10.0.3-beta.3", "version": "10.0.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -2,7 +2,7 @@
"name": "lamassu-server", "name": "lamassu-server",
"description": "bitcoin atm client server protocol module", "description": "bitcoin atm client server protocol module",
"keywords": [], "keywords": [],
"version": "10.0.3-beta.3", "version": "10.0.3",
"license": "./LICENSE", "license": "./LICENSE",
"author": "Lamassu (https://lamassu.is)", "author": "Lamassu (https://lamassu.is)",
"dependencies": { "dependencies": {