diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs index 139ce94..5257fab 100644 --- a/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs @@ -8,10 +8,10 @@ public class Car public string Car_Mark { get; private set; } = string.Empty; public string Car_Model { get; private set; } = string.Empty; public Car_Type Car_Type { get; private set; } + public Driver_License License { get; private set; } public float Consumption_Rate { get; private set; } - public int Fuel_ID { get; private set; } - public static Car CreateEntity (int car_ID, string car_mark, string car_model, Car_Type car_type, float consumption, int fuel_id) + public static Car CreateEntity (int car_ID, string car_mark, string car_model, Car_Type car_type, Driver_License license, float consumption) { return new Car { @@ -19,8 +19,8 @@ public class Car Car_Mark = car_mark ?? string.Empty, Car_Model = car_model ?? string.Empty, Car_Type = car_type, - Consumption_Rate = consumption, - Fuel_ID = fuel_id + License = license, + Consumption_Rate = consumption }; } } diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Refill.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Refill.cs new file mode 100644 index 0000000..a67ff0b --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Refill.cs @@ -0,0 +1,22 @@ +namespace FuelAndLubricants.Entities; + +public class Refill +{ + public int Refill_ID { get; private set; } + public DateTime Refill_Date { get; private set; } + public float Refill_Amount { get; private set; } + public int Fuel_ID { get; private set; } + public int Car_ID { get; private set; } + + public static Refill CreateOperation(int refill_ID, DateTime refill_date, float refill_amount, int fuel_id, int car_id) + { + return new Refill + { + Refill_ID = refill_ID, + Refill_Date = refill_date, + Refill_Amount = refill_amount, + Fuel_ID = fuel_id, + Car_ID = car_id + }; + } +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs index 25af9ec..3087552 100644 --- a/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs @@ -4,7 +4,7 @@ public class Route { public int Route_ID { get; private set; } public string Start_Point { get; private set; } = string.Empty; - public string End_Point { get; private set;} = string.Empty; + public string End_Point { get; private set; } = string.Empty; public float Route_Length { get; private set; } public static Route CreateEntity (int route_id, string start_point, string end_point, float length) diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs index 218d322..1a7dd80 100644 --- a/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs @@ -13,7 +13,7 @@ public class Trip public int Driver_ID { get; private set; } public int Route_ID { get; private set; } - public static Trip CreateEntity(int trip_id, DateTime start_date, DateTime end_date, Shift shift, float consumption, int car_id, int driver_id, int route_id) + public static Trip CreateOperation(int trip_id, DateTime start_date, DateTime end_date, Shift shift, float consumption, int car_id, int driver_id, int route_id) { return new Trip { diff --git a/FuelAndLubricants/FuelAndLubricants/Repositories/ICarRepository.cs b/FuelAndLubricants/FuelAndLubricants/Repositories/ICarRepository.cs index 86c62e5..a4d9d34 100644 --- a/FuelAndLubricants/FuelAndLubricants/Repositories/ICarRepository.cs +++ b/FuelAndLubricants/FuelAndLubricants/Repositories/ICarRepository.cs @@ -10,7 +10,7 @@ public interface ICarRepository void CreateCar(Car car); - //void UpdateCar(Car car); + void UpdateCar(Car car); void DeleteCar(int id); } diff --git a/FuelAndLubricants/FuelAndLubricants/Repositories/IRefillRepository.cs b/FuelAndLubricants/FuelAndLubricants/Repositories/IRefillRepository.cs new file mode 100644 index 0000000..ca33f73 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Repositories/IRefillRepository.cs @@ -0,0 +1,12 @@ +using FuelAndLubricants.Entities; + +namespace FuelAndLubricants.Repositories; + +public interface IRefillRepository +{ + IEnumerable ReadRefills(); + + Trip ReadRefillByID(int id); + + void CreateRefill(Refill refill); +} diff --git a/FuelAndLubricants/FuelAndLubricants/Repositories/IRouteRepository.cs b/FuelAndLubricants/FuelAndLubricants/Repositories/IRouteRepository.cs index 8810642..7a5ee9b 100644 --- a/FuelAndLubricants/FuelAndLubricants/Repositories/IRouteRepository.cs +++ b/FuelAndLubricants/FuelAndLubricants/Repositories/IRouteRepository.cs @@ -10,7 +10,7 @@ public interface IRouteRepository void CreateRoute(Route route); - //void UpdateRoute(Route route); + void UpdateRoute(Route route); void DeleteRoute(int id); } diff --git a/FuelAndLubricants/FuelAndLubricants/Repositories/ITripRepository.cs b/FuelAndLubricants/FuelAndLubricants/Repositories/ITripRepository.cs index 87c847b..0f68261 100644 --- a/FuelAndLubricants/FuelAndLubricants/Repositories/ITripRepository.cs +++ b/FuelAndLubricants/FuelAndLubricants/Repositories/ITripRepository.cs @@ -9,8 +9,4 @@ public interface ITripRepository Trip ReadTripByID(int id); void CreateTrip(Trip trip); - - //void UpdateTrip(Trip trip); - - void DeleteTrip(int id); }