התרחיש
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.