GoodDollar / GoodWeb3-Mono

mono repo with GoodDollar's web3 UI components and SDK
https://gooddollar-storybook.vercel.app
0 stars 0 forks source link

[GoodID-UI] - Segmentation screen #117

Open L03TJ3 opened 5 months ago

L03TJ3 commented 5 months ago

Business Description

https://github.com/GoodDollar/GoodWeb3-Mono/issues/140

Detailed Description of Functionality

After someone successfully scanned their face, we should show a screen to confirm the data that was scanned.

HappyPath:The flow of the screen when the user reaches the segmentation screen:

  1. A modal pops up showing we are processing their data
  2. We request location permission
  3. we get their fv signature from local storage which we saved at the start of the onboarding flow (If not found on gooddapp, we do have to request their signature again. on the wallet too, but we can do this in the background without the user having to sign)
  4. two calls are made to the api endpoints 'identity' and 'location'. we get a verifiable credential for each from the goodserver
  5. the certificates are stored in the certificates db
  6. the verified values for age,gender,location are then read from the certificates
  7. age needs to be destructured through the from/to fields of the credentialsubject in the Age certificate
  8. country name needs to be mapped from the country code taken from the credentialsubject in the Location certificate
  9. gender can be taken as is from the credentialsubject in the Gender certificate
  10. the modal closes and we show the segmentation screen with the three values and two buttons where a user can agree/disagree with the shown values

Where does a user navigate to after

Unhappy path:

When processing the data and requesting the certificates something can go wrong. Could be a technical error, could be a user denies permission to read location etc In any circumstance where we are not able to verify all their data they will see a similar segmentation screen but the action of the buttons is different.

  1. whichever value we were not able to determine will be shown as 'Unverified'
  2. Because we could not determine all values when the user clicks on 'Yes, I am' will be in this scenario skipping the 'agreement' screen and will continue to the final 'confirmation screen'

Acceptance Criteria

vldkhh commented 3 weeks ago

verified on storybook