Skip to content

Commit

Permalink
feat: smart-prefill tradle.pg.PersonalDetails from tradle.PhotoID
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Feb 19, 2018
1 parent 05c2e21 commit e2b7d2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/samplebot/plugins/smart-prefill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Bot, IPBApp, ResourceStub, Name, IPluginOpts } from '../types'
const { parseStub } = validateResource.utils
const PHOTO_ID = 'tradle.PhotoID'
const ONFIDO_APPLICANT = 'tradle.onfido.Applicant'
const PG_PERSONAL_DETAILS = 'tradle.pg.PersonalDetails'

// const canPrefillFromPhotoID = ({ application, formRequest }) => {
// if (!doesApplicationHavePhotoID(application)) return false
Expand Down Expand Up @@ -72,6 +73,9 @@ export const transformers = {

_.extend(props, _.pick(source, ['dateOfBirth', 'country']))
return props
},
[PG_PERSONAL_DETAILS]: (source: IPersonalInfo) => {
return _.pick(source, ['firstName', 'lastName', 'dateOfBirth'])
}
}
}
Expand Down

0 comments on commit e2b7d2e

Please sign in to comment.