Skip to main content

Screens diagram

since app build #3

Diagram that illustrates the flow of user interaction in the application

graph TD; SCREEN_HOME[SCREEN: Home Screen] SCREEN_HOME --> |Scan Button Touched| SCREEN_SCAN SCREEN_SCAN[SCREEN: Scan Code] SCREEN_SCAN --> |Code Scanned|CHOICE_ISSETTINGS CHOICE_ISSETTINGS{Type of Scanned Code} CHOICE_ISSETTINGS --> |Regular Code|CHOICE_ISAPISET CHOICE_ISSETTINGS --> |New Settigns Code|NOTIFICATION_SETTINGS NOTIFICATION_SETTINGS(New Settings applied notification) --> SCREEN_HOME CHOICE_ISAPISET{Is API endpoint set?} CHOICE_ISAPISET --> |Yes| CHOICE_ISFORMDATA CHOICE_ISAPISET --> |No| NOTIFICATION_ERROR CHOICE_ISFORMDATA{"Is (persistent) formData stored?"} CHOICE_ISFORMDATA --> |Yes: Show screen form| SCREEN_FORM CHOICE_ISFORMDATA --> |No| PROCESS_API_REQUEST PROCESS_API_REQUEST(Send code to API) PROCESS_API_REQUEST --> CHOICE_MISSING NOTIFICATION_ERROR(Error Notification) --> SCREEN_HOME SCREEN_FORM[SCREEN: Show Form] --> |data entered|PROCESS_API_REQUEST CHOICE_MISSING{Is formData missing?} SCREEN_STATUS[SCREEN: Status Screen] CHOICE_MISSING --> |"Yes (response can include new ad-hoc or persistent formData)"|SCREEN_FORM CHOICE_MISSING --> |No|SCREEN_STATUS SCREEN_STATUS --> SCREEN_HOME

Missing formData#

If you expect that the information provided by user should include more information, not just the scanned value, you can return the status text missingData. You must provide formData in the API response also.

    if status == 'missingData' and isFormDataPresent then    -- SHOW FORM ...    end