Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

add schema to store national identity information for ~users #3976

Closed
wants to merge 14 commits into from

Conversation

chadwhitacre
Copy link
Contributor

@chadwhitacre chadwhitacre commented Apr 1, 2016

#3994
#4006

Alright, let's do this. The eating of an 🐘 begins with the first bite! 🍴

Punchlist

  • require schema_version in info field
  • add client-side encryption to info field(!)
  • log events
  • finish docs
  • clean up commits

PRs

@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Apr 1, 2016

I'm thinking that we'll use client-side encryption on the participant_identities.info field.

At this point we know very little about what exactly we'll need to collect. It may vary from country to country, and I suspect it'll be driven largely by the third-party verification vendor(s) we end up going with. Going with a JSON field for now seemed like the easiest way to get started.

I think we should allow multiple identities per ~user, but only one per ~user per country (we should account for dual citizenship, in other words).

I guess let's log changes to the events table, with the old info in the payload as with ... wherever else it was that we did that recently. :-)

@chadwhitacre
Copy link
Contributor Author

I'm expecting that eventually we'll add a team_identities table that links with teams.

@chadwhitacre
Copy link
Contributor Author

At a minimum, the bank must obtain the following identifying information from each customer before opening the account:

  • Name.
  • Date of birth for individuals.
  • Address.
  • Identification number.

#3289 (comment)

@chadwhitacre chadwhitacre added this to the Payroll milestone Apr 1, 2016
@chadwhitacre
Copy link
Contributor Author

Turns out we have an identity form still hanging around post-Balanced.

@mattbk
Copy link
Contributor

mattbk commented Apr 1, 2016

I guess let's log changes to the events table, with the old info in the payload as with ... wherever else it was that we did that recently. :-)

#3923 (comment)

INSERT INTO countries (name, code) VALUES ('Western Sahara*', 'ESH');
INSERT INTO countries (name, code) VALUES ('Yemen', 'YEM');
INSERT INTO countries (name, code) VALUES ('Zambia', 'ZMB');
INSERT INTO countries (name, code) VALUES ('Zimbabwe', 'ZWE');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geez. Why not a single multi row INSERT statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Laziness, sorry. Cleaned up in d78a132. 😊

@chadwhitacre chadwhitacre changed the title store national identity information add schema to store national identity information for ~users Apr 20, 2016
@chadwhitacre
Copy link
Contributor Author

Rebased on master at 4270aa0. Previous head was 1b97231.

@chadwhitacre chadwhitacre force-pushed the identities branch 2 times, most recently from 651d843 to f364a61 Compare April 28, 2016 14:58
@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Apr 28, 2016

Lotta discussion over here. A summary:

  • Individuals can renounce their citizenship. We should allow ~users to deactivate the national identities they have stored with us.
  • Countries fork and merge. This would be a case of mass deactivation and reregistration.
  • Deactivating one's last participant_identities should a) either remove you from all Teams, or b) be prevented if you're still on a Team. Probably the former?
  • Our recent pattern has been to include old info in the events table when we log changes. However, we want to keep PII in one place; we don't want to also store it in the events table. What we're thinking is that we'll use our old ctime/mtime pattern (a la payment_instructions)—still also logging to events, but with the ids of the old and new records rather than the full info.
  • We don't want to overengineer the info schema right now. We'll collect (add schema to store national identity information for ~users #3976 (comment)) name, address, date of birth, and identity number (allowing for national id, drivers license, and/or passport). We should version the schema so we're in a better position as we need to start validating it more strictly.

@chadwhitacre
Copy link
Contributor Author

@kaguillera
Copy link
Contributor

Sprite/css flags alternative as discussed
https://www.flag-sprites.com/

@kaguillera
Copy link
Contributor

kaguillera commented Apr 28, 2016

flags

CSS: (https://gist.github.com/kaguillera/267ee747bd1e7679732b81d7b2f78d10)

Sample code for Czech Republic flag
<img src="blank.gif" class="flag flag-cz" alt="Czech Republic" />

@chadwhitacre
Copy link
Contributor Author

I'm now questioning why we need to retain old PII. Seems safer to simply delete or overwrite it as requested.

@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Apr 29, 2016

More like a2c1d31 (previous was fd6d635).

@chadwhitacre
Copy link
Contributor Author

screen shot 2016-04-28 at 11 47 44 pm

@chadwhitacre chadwhitacre force-pushed the identities branch 2 times, most recently from 5388d4d to f953a4f Compare April 30, 2016 15:26
@chadwhitacre
Copy link
Contributor Author

Okay! Got a good chunk of work done here. I am ruminating on how to carve this up into easily reviewable PRs ...

@chadwhitacre chadwhitacre force-pushed the identities branch 2 times, most recently from a0dac4e to 5c5ef50 Compare April 30, 2016 20:09
@chadwhitacre
Copy link
Contributor Author

I thought we already had participants.has_verified_email

It's not a boolean, it's the address itself: participants.email_address.

@chadwhitacre chadwhitacre modified the milestone: Bring Back Payroll for Team Gratipay May 4, 2016
@chadwhitacre
Copy link
Contributor Author

Old head was 9907401.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants