Database design for bus reservation

前端 未结 2 983
太阳男子
太阳男子 2021-01-31 06:12

I\'m developing a reservation module for buses and I have trouble designing the right database structure for it.

Let\'s take following case:
Buses go from A to D w

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-31 07:10

    From the perspective of bus company:

    Usually one route is considered as series of sections, like A to B, B to C, C to D, etc. The fill is calculated on each of those sections separately. So if the bus leaves from A full, and people leave at C, then user can buy ticket at C.

    We calculate it this way, that each route has ID, and each section belongs to this route ID. Then if user buys ticket for more than one section, then each section is marked. Then for the next passenger system checks if all sections along the way are available.

提交回复
热议问题