Schedule movement of car between offices in a car rental scenario
-
Hi, I need some thoughts on a design for at car rental service. Multiple offices exists in the company. An office can move a car from its car pool to another office if demands in their region changes. A car movement can be based on seasonal reasons and therefore a move can be scheduled in advance. How do I solve the double relationship that would exist when a scheduled move has be invoked? The car still belongs to office 1 until a certain date. But the car also belongs to office 2 when that date has been reached. Meaning that office 1 can still lease it out until that date and office 2 can start leasing it out from that date. My first thought is to create a many to many relationship like this. CARS -------- ID | Name 1 | Ford STATION --------- ID | Name 1 | NY 2 | BOS STATION_CARS ------------------------------------------------------- StationID | CarID | DateAvailableFrom | DateAvailableTo 1 | 1 | 01.01.2011 | 01.11.2011 2 | 1 | 02.11.2001 | 01.02.2012 But i also need to register the "scheduled move" object, making it visible to the staff and deleteable, in another table. Seems kind of messy so i wonder how others have dealt with this scenario. Any thoughts would be much appreciated.
-
Hi, I need some thoughts on a design for at car rental service. Multiple offices exists in the company. An office can move a car from its car pool to another office if demands in their region changes. A car movement can be based on seasonal reasons and therefore a move can be scheduled in advance. How do I solve the double relationship that would exist when a scheduled move has be invoked? The car still belongs to office 1 until a certain date. But the car also belongs to office 2 when that date has been reached. Meaning that office 1 can still lease it out until that date and office 2 can start leasing it out from that date. My first thought is to create a many to many relationship like this. CARS -------- ID | Name 1 | Ford STATION --------- ID | Name 1 | NY 2 | BOS STATION_CARS ------------------------------------------------------- StationID | CarID | DateAvailableFrom | DateAvailableTo 1 | 1 | 01.01.2011 | 01.11.2011 2 | 1 | 02.11.2001 | 01.02.2012 But i also need to register the "scheduled move" object, making it visible to the staff and deleteable, in another table. Seems kind of messy so i wonder how others have dealt with this scenario. Any thoughts would be much appreciated.
I am no expert with this stuff. But I would personally think that a "Scheduled Moves" table (a junction table) would be the best solution. I say this based on what I have learned over the past several months. Scheduled Moves SourceStationID, DestinationStationID, CarID, DateEffective Those are the fields I would see in the junction table. Just my opinion.
djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.
-
Hi, I need some thoughts on a design for at car rental service. Multiple offices exists in the company. An office can move a car from its car pool to another office if demands in their region changes. A car movement can be based on seasonal reasons and therefore a move can be scheduled in advance. How do I solve the double relationship that would exist when a scheduled move has be invoked? The car still belongs to office 1 until a certain date. But the car also belongs to office 2 when that date has been reached. Meaning that office 1 can still lease it out until that date and office 2 can start leasing it out from that date. My first thought is to create a many to many relationship like this. CARS -------- ID | Name 1 | Ford STATION --------- ID | Name 1 | NY 2 | BOS STATION_CARS ------------------------------------------------------- StationID | CarID | DateAvailableFrom | DateAvailableTo 1 | 1 | 01.01.2011 | 01.11.2011 2 | 1 | 02.11.2001 | 01.02.2012 But i also need to register the "scheduled move" object, making it visible to the staff and deleteable, in another table. Seems kind of messy so i wonder how others have dealt with this scenario. Any thoughts would be much appreciated.