This is a valid JSON array adopted from an XML string, but I am not sure that if it is structured optimally. It represents an employee schedule with hierarchy of schedule->employees->employee>tasks->task Should tasks be a hierarchy below employee? Am I using [] square brackets in the right places?
{
"schedule": {
"employees": [
{
"employee": "1000",
"tasks": [
{
"task1": {
"site":"McDo",
"from":"0900",
"to":"1000"
}
},
{
"task2": {
"site":"McDo",
"from":"0900",
"to":"1000"
}
}
]
},
{
"employee": "2000",
"tasks": [
{
"task3": {
"site":"HJ",
"from":"0900",
"to":"1000"
}
},
{
"task4": {
"site":"KFC",
"from":"0900",
"to":"1000"
}
}
]
}
]
}
}
requirements:
- schedule->employees (1:N)
- employees->employees (1:N) - not sure if I need this
- employee->tasks (1:N)
- tasks-> task (1:N) - not sure if I need this
- task->site (1:1)