ID Photo Process
How does the ID photo process work? Z is a part of it, but there are other parts...
For documentation on the ID badges themselves, see this random Google Doc (for now).
Uploading ID Photos
We host the photo ID service externally to Portico and GENE because both services require photos at various times - for example, when we require an ID photo from students and from staff. Currently, we're hosting the Photo ID service as part of Z, so that when we migrate the rest of our photo ID process to Z it won't have anywhere to go and will no longer require a REST API.
Storing Photos for IDs
The first place that we ask for an ID photo is in an enrollment form in GENE. This process works as follows:
sequenceDiagram
Actor Human
Links Z: {"Docs": "https://docs.z.explo.org", "Teamwork Project": "https://explo.teamwork.com/#/projects/777372/overview/activity"}
Links GENE: {"Teamwork Project": "https://explo.teamwork.com/#/projects/780686/overview/activity"}
Links HIVE: {"Teamwork Project": "https://explo.teamwork.com/#/projects/782840/overview/activity"}
Human ->> GENE: Open Photo ID Form
GENE -->> Z: Redirect browser to new Photo ID Form
Z ->> Human: Show new Photo ID Form
Human ->> Z: Upload photo
Z -->> Cloudinary: Upload photo
Cloudinary -->> Z: Return `{:cloudinary_public_id, resource: {lots_of_data}}`
Z -->> HIVE: POST atom `{z, photo_id, upload, {:entity_id, :cloudinary_public_id, :resource}}`
alt: Success!
Z -->> GENE: Success!
GENE ->> Human: Success! Close photo ID form, redirect to dashboard.
else: Some error, probably with HIVE
Z -->> GENE: Dang!
GENE ->> Human: ERROR
end
Note over Human: Meanwhile, in HIVE land...
HIVE -->> Portico: Here's a new Photo ID!
Portico -->> Portico: (Downloads photo, does stuff, marks checklist as complete)
Portico -->> GENE: The photo ID form is done!
GENE -->> GENE: Yes, I assumed this when the form came back from Z, but still I'll mark it as done to be sure...
GENE ->> Human: The photo ID form is done!
Portico receives the photo URL, and downloads the photo from that URL as a post-sync script on the HIVE atom. If for any reason an alteration of the photo is needed (typically a rotation), Portico can request an altered url from the show/2
endpoint.
From within Portico, we will often want to send people back to the "take a photo" form, independently of the Portal. This works similarly to the Portal process above, with an optional step for shortening the URL to make it more convenient to type, and also to notify GENE that the photo has been taken if necessary.
Resources
In Z, check out: