情境
A smart bus system needs to track passengers, assign discounts, schedule trips on routes with specific buses, and record ticket bookings and payments.
這張圖裡有什麼
看懂背後的決策。
01
Discounts are linked as a many-to-one optional relationship so passengers may have no discount.
02
Payment details (method, status, amount) are embedded in the Ticket rather than separated into a distinct Payment entity to simplify the schema.
03
Trips associate a bus and a route, with a base price that can be overridden per ticket if needed.
Use this schema when building a public transit ticketing backend that supports passenger accounts, discount programs, and per-trip seat booking.