Shifts created at Organisation A carry over to Organisation B
death667b opened this issue · 2 comments
Issue:
If I create two shifts with organisation A with userId: 1 (as shown at the end). If I then leave that organisation and join organisation B those shifts immediately appear with organisation B.
Expectation:
When I leave organisation A those shifts should not come across to organisation B.
Cause:
The data in the shifts table does not contain which organisation any shift was created against. So it is assumed the shift is owned by the user in which every organisation they currently belong to.
Suggested Fix:
At a organisationId column to the shifts table. Then the user could have shifts in multiple companies.
Sample from my Get /shifts
{
"id": 1,
"userId": 1,
"start": "2018-01-01 10:15",
"finish": "2018-01-01 10:20",
"breakLength": 30
},
{
"id": 2,
"userId": 2,
"start": "2018-01-01 14:15",
"finish": "2018-01-01 16:20",
"breakLength": 30
},
{
"id": 3,
"userId": 1,
"start": "2018-01-02 09:15",
"finish": "2018-01-02 16:20",
"breakLength": 30
},
Nevermind, by design 👍
This is actually a mistake by us for not making it clear. For now I think the functionality is fine, but it's a good point, maybe leaving the organisation should destroy all the user's shifts at that org.