diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs new file mode 100644 index 0000000..139ce94 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Car.cs @@ -0,0 +1,26 @@ +using FuelAndLubricants.Entities.Enums; + +namespace FuelAndLubricants.Entities; + +public class Car +{ + public int Car_ID { get; private set; } + 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 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) + { + return new Car + { + Car_ID = car_ID, + Car_Mark = car_mark ?? string.Empty, + Car_Model = car_model ?? string.Empty, + Car_Type = car_type, + Consumption_Rate = consumption, + Fuel_ID = fuel_id + }; + } +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Driver.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Driver.cs new file mode 100644 index 0000000..7899494 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Driver.cs @@ -0,0 +1,22 @@ +using FuelAndLubricants.Entities.Enums; + +namespace FuelAndLubricants.Entities; + +public class Driver +{ + public int Driver_ID { get; private set; } + public string Firstname { get; private set; } = string.Empty; + public string Secondname { get; private set; } = string.Empty; + public Driver_License Driver_License { get; private set; } + + public static Driver CreateEntity (int driver_ID, string firstname, string secondname, Driver_License license) + { + return new Driver + { + Driver_ID = driver_ID, + Firstname = firstname ?? string.Empty, + Secondname = secondname ?? string.Empty, + Driver_License = license + }; + } +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Car_Type.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Car_Type.cs new file mode 100644 index 0000000..a700a41 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Car_Type.cs @@ -0,0 +1,9 @@ +namespace FuelAndLubricants.Entities.Enums; + +public enum Car_Type +{ + None = 0, + Passenger = 1, + Cargo = 2, + Bus = 3 +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Driver_License.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Driver_License.cs new file mode 100644 index 0000000..ae865a1 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Driver_License.cs @@ -0,0 +1,13 @@ +namespace FuelAndLubricants.Entities.Enums; + +[Flags] +public enum Driver_License +{ + None = 0, + A = 1, + B = 2, + C = 4, + D = 8, + BE = 16, + CE = 32 +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Fuel_Type.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Fuel_Type.cs new file mode 100644 index 0000000..b408283 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Fuel_Type.cs @@ -0,0 +1,10 @@ +namespace FuelAndLubricants.Entities.Enums; + +public enum Fuel_Type +{ + None = 0, + + Petrol = 1, + + Diesel = 2 +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Shift.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Shift.cs new file mode 100644 index 0000000..a05e003 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Enums/Shift.cs @@ -0,0 +1,8 @@ +namespace FuelAndLubricants.Entities.Enums; + +public enum Shift +{ + None = 0, + Day = 1, + Night = 2 +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Fuel_And_Lubricants.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Fuel_And_Lubricants.cs new file mode 100644 index 0000000..5928429 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Fuel_And_Lubricants.cs @@ -0,0 +1,22 @@ +using FuelAndLubricants.Entities.Enums; + +namespace FuelAndLubricants.Entities; + +public class Fuel_And_Lubricants +{ + public int Fuel_ID { get; private set; } + public Fuel_Type Fuel_Type { get; private set; } + public float Price_Per_Liter { get; private set; } + public float Amount { get; private set; } + + public static Fuel_And_Lubricants CreateEntity(int fuel_id, Fuel_Type type, float price, float amount) + { + return new Fuel_And_Lubricants + { + Fuel_ID = fuel_id, + Fuel_Type = type, + Price_Per_Liter = price, + Amount = amount + }; + } +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs new file mode 100644 index 0000000..25af9ec --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Route.cs @@ -0,0 +1,20 @@ +namespace FuelAndLubricants.Entities; + +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 float Route_Length { get; private set; } + + public static Route CreateEntity (int route_id, string start_point, string end_point, float length) + { + return new Route + { + Route_ID = route_id, + Start_Point = start_point ?? string.Empty, + End_Point = end_point ?? string.Empty, + Route_Length = length + }; + } +} diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs new file mode 100644 index 0000000..218d322 --- /dev/null +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs @@ -0,0 +1,30 @@ +using FuelAndLubricants.Entities.Enums; + +namespace FuelAndLubricants.Entities; + +public class Trip +{ + public int Trip_ID { get; private set; } + public DateTime Start_Date { get; private set; } + public DateTime End_Date { get; private set; } + public Shift Shift { get; private set; } + public float Fuel_Consumption { get; private set; } + public int Car_ID { get; private set; } + 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) + { + return new Trip + { + Trip_ID = trip_id, + Start_Date = start_date, + End_Date = end_date, + Shift = shift, + Fuel_Consumption = consumption, + Car_ID = car_id, + Driver_ID = driver_id, + Route_ID = route_id + }; + } +}