I have a water taxi booking system with direct, non-stop routes, which works fine.
Now I have business scenario where one route has multiple stops. So if the starting point of the route is location A, then end point could be location E, with stops at B, C, and D. In between these A and E locations a passenger can board or disembark at any time, meaning it has permutations and combinations of possible start and stop points. So this is more like a metro bus route now.
How can I support this, so I can know capacity at any point along the way?
The existing system is built for continuous (nonstop) A-B routes, where vessel capacity is calculated for the particular start and stop for the full route.
What I have tried:
Added a vessel entity which has a capacity field.
I added a Legs entity, which specifies the start and stop, as well as a sail entity which uses leg and vessel assigned to it with capacity. We also added a booking entity which makes booking for the passenger and deducts the capacity from sail entity.
This system works fine with non-stop routes, where passengers board at point A, disembark at point B, and there are no stops in between. But now I need to support more-complicated routes.