I´m currently creating my first restful API for a WebApp and I´m at a point where I´m not sure, how to best structuring it.
I´m developing a Holiday planer for a Company. The company is separated in a few departments. So some users are in Department A and some in B for example.
The department information would be accessible
/department/ and the users in
All Users can make a holiday request. Let´s stay this would be accessible
/holiday/. For each department there is a minStock of Users that must stay in the Company, so that our product support is still alive ;) As you can see there is a close relation between the departments, users and request/ confirmed holiday bookings.
Possible way of doing it, or not?
At one point I have to display in my UI which Users of a specific department already have requested a holiday, so this could be either
/department/holiday/:departmentID. Probably I´m totally wrong here and you would design it completely different.
I don´t want to put too much information here and just stay at this simple example. I´m excited to know how you would do it when just looking at this information.
If I missed something, just ask me in the Comments and I will do my best to provide you everything you need to help me!
Of course at some point in my APP I will need all holiday request´s without filtering for a department. I´m not sure if this will influence the overall design, just want to add this here.