Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation for contacts #55

Closed
oliverroick opened this issue Feb 5, 2016 · 5 comments
Closed

Validation for contacts #55

oliverroick opened this issue Feb 5, 2016 · 5 comments
Assignees
Milestone

Comments

@oliverroick
Copy link
Member

Organisation contacts will be stored as JSON using a hcard-like format. A custom validator function is required for the field, that checks if required fields are provided, correct types and formats.

jsonschema can be used for validation.

@oliverroick oliverroick self-assigned this Feb 5, 2016
@oliverroick oliverroick added this to the Version 0.01.1 milestone Feb 5, 2016
@oliverroick
Copy link
Member Author

I have implemented basic validation for contacts, based on jsonschema. It is re-usable and can be reused for any validation of contacts.

I believe, that fully implementing the hcard format is overhead so I implemented a stripped-down version (but that can be changed, all we need to do is change the schema definition). The format is:

"name": {"type": "string"},
"email": {"type": "string", "format": "email"},
"url": {"type": "string", "format": "uri"},
"street-address": {"type": "string"},
"locality": {"type": "string"},
"postal-code": {"type": "string"},
"country-name": {"type": "string"},
"tel": {"type": "string"},
"job-title": {"type": "string"}

Am I missing any important information that should be collected for contacts?

Right now only name is required. I was thinking of making email and phone number, so that a user has to provide at least one of them.

@wonderchook
Copy link
Contributor

@nastynoel any other contact information we should provide as an option? As stated only name is currently required, but all the others are available optionally.

@nastynoel
Copy link

@wonderchook - we're talking contacts for Project Administrators, field staff, or individuals who have data collected? Or all of the above. If Administrators, it should be mandatory to have either mobile phone or email included. Ideally, these details would be validated through a two step process, i.e. set up the account, after which the platform sends an email to the address requiring confirmation of the account creation, or sends a confirmation code via SMS to the mobile for entry back into the account creation page(s).

Any particular reason for including Job Title?

@wonderchook
Copy link
Contributor

@nastynoel this is a reusable component for validating any contacts in the platform. So if I read you correctly you can't think of any other fields that we should include optionally?

Job Title might be useful in large organizations, not required in this case though.

@nastynoel
Copy link

correct

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

No branches or pull requests

4 participants