namespace ca.mcgill.ecse321.parkinglotbackend.model;

class ParkingLotSoftwareSystem {
  long parkingLotSoftwareSystemID;
  float monthlyFee;
  float feePer15m;
  int maxStay;      //in minutes
  int numberOfRegularParkingSpots;
  int numberOfLargeParkingSpots;
  int numberOfMonthlyFloors;
  int numberOfMonthlySpotsPerFloor;
  int numberOfGarages;

  0..1 system <- * TimeSlot openingHours;
}

class Account {
  long accountID;
  email;    //unique
  password;
}

class Person {
  long personID;
  phoneNumber;  //unique
  name;
  
  1 person <- 0..1 Account account;
  1 owner <- * Car cars;
}

class StaffAccount {
  isA Account;

  float salary;
  
  0..1 <- * TimeSlot;
}

class ManagerAccount {
  isA StaffAccount;
}

class Car {
  long carID;
  licensePlate;    //unique
  make;
  model;
}

class MonthlyReservation {
  long monthlyReservationID;
  LocalDate startDate;
  LocalDate endDate;

  0..1 monthlyReservation <- 1 ParkingSpot parkingSpot;
  * monthlyReservations -> 1 Person person;
}

class ParkingSpot {
  long parkingSpotID;
  int floor;
  int number;
}

class Service {
  long serviceID;
  description;
  float cost;
  int duration;     //in minutes
}

class Garage {
  long garageID;

  int garageNumber;    //unique and generated
}

class ServiceAppointment {
  enum AppointmentStatus {
    Ready,
    InProgress,
    Competed
  }
  long serviceAppointmentID;
  LocalDateTime startTime;
  AppointmentStatus appointmentStatus;

  * appointments -> 1 Service service;
  * appointments -> 1 Garage garage;
  * appointments -> 1 Car car;
  }

class Ticket {
  enum CarType {
    Regular,
    Large
  }
  long ticketID;
  LocalDateTime entryTime;
  CarType carType;

  * tickets -> 1 ParkingLotSoftwareSystem;
}

class TimeSlot {
  long timeSlotID;
  DayOfWeek dayOfTheWeek;
  LocalTime startTime;
  LocalTime endTime;
}
