-
-
Save paolobueno/acbb0823183124c6a0f8906ad9cad015 to your computer and use it in GitHub Desktop.
Workflow mobile data structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var workorder = { | |
| "_id": "59aafac97037bfbab2a8f9a1", | |
| "id": "SJ8b3Mr8g", | |
| "assignee": "rkX1fdSH", | |
| "title": "Accident No. 3019", | |
| "status": "New", | |
| "stepHistory": [ | |
| { | |
| id: 'someid', | |
| user: 'trever' | |
| } | |
| ], // This is created when we going thru workflow. | |
| // Array of results as they are filled, | |
| // previous() could just delete the last one, user experience tradeoff | |
| // rendered sequentially on results screen | |
| results: [ | |
| { | |
| stepId: 'someid', | |
| timestamp: 23165498654, | |
| user: 'trever', // future support for multi-user workorders | |
| data: { | |
| tires: true, | |
| lights: true, | |
| fuel: 75 | |
| } | |
| } | |
| ], | |
| "workflow": { | |
| "id": "SyVXyMuSr", | |
| "version": 1, // should be easy to implement server-side | |
| // stepFlow : _.map(workflow.steps,'id') | |
| "stepFlow": ['someid', 'someid2', 'someid'], | |
| "title": "Vehicle Accident Workflow", | |
| "steps": [ | |
| { | |
| "id": "someid", | |
| "code": "accident-report-form", | |
| "name": "Accident Report", | |
| }, | |
| { | |
| "id": "someid2", | |
| "code": "accident-report-form", | |
| "name": "Accident Report", | |
| }, | |
| { | |
| "code": "vehicle-inspection", | |
| "name": "Vehicle Inspection", | |
| } | |
| ] | |
| } | |
| }; | |
| console.dir(workorder); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment