msc {
# Options
hscale="1.5", wordwraparcs=1;
# Define the actors
User, Email, Server, Database;
# Title note
User note Database [
label="Describes the process of updating an existing attendee's information",
textbgcolor="aqua"];
# Define the messages
User->Server [label="View attendee information"];
Server->Database [label="Get attendee information"];
Server->User [label="Share attendee information"];
...;
User->Server [label="Request to edit attendee information"];
Server=>Server [label="Determine appropriate email to challenge"];
Server=>Server [label="Verify email safety"];
--- [label="If email unsafe, return unavailable response"];
Server->User [label="Unavailable",
linecolor="red"];
--- [label="Otherwise issue a new challenge"];
Server->Database [label="Create new challenge pair"];
Server->User [label="Send challenge id"];
Server->Email [label="Send challenge code", arcskip=1];
|||;
Email->User [label="Share challenge code", arcskip=1];
|||;
User->Server [label="Updated attendee info w/ code & id"];
Server->Database [label="Verify challenge code & id"];
Server=>Server [label="Validate data"];
--- [label="If code expired or invalid, return bad auth response"];
Server->User [label="Bad Auth",
linecolor="red"];
--- [label="Otherwise, update the attendee"];
Server->Database [label="Update attendee info"];
Server->User [label="Return updated attendee info"];
}