diff --git a/AutobusApi.Domain/Entities/Address.cs b/AutobusApi.Domain/Entities/Address.cs index f2594c1..0e7fbdf 100644 --- a/AutobusApi.Domain/Entities/Address.cs +++ b/AutobusApi.Domain/Entities/Address.cs @@ -6,15 +6,15 @@ namespace AutobusApi.Domain.Entities; public class Address : EntityBase { - public required string Name { get; set; } + public string Name { get; set; } = null!; - public required ICoordinates Location { get; set; } + public ICoordinates Location { get; set; } = null!; - public required VehicleType VehicleType { get; set; } + public VehicleType VehicleType { get; set; } public ICollection RouteAddresses { get; set; } = null!; - public required int CityId { get; set; } + public int CityId { get; set; } public City City { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/Aircraft.cs b/AutobusApi.Domain/Entities/Aircraft.cs index 5148393..520dd59 100644 --- a/AutobusApi.Domain/Entities/Aircraft.cs +++ b/AutobusApi.Domain/Entities/Aircraft.cs @@ -4,13 +4,13 @@ public class Aircraft : Vehicle { public Vehicle Vehicle { get; set; } = null!; - public required string Number { get; set; } + public string Number { get; set; } = null!; - public required string Model { get; set; } + public string Model { get; set; } = null!; - public required int Capacity { get; set; } + public int Capacity { get; set; } - public required bool HasWiFi { get; set; } + public bool HasWiFi { get; set; } - public required bool HasMultimedia { get; set; } + public bool HasMultimedia { get; set; } } diff --git a/AutobusApi.Domain/Entities/Bus.cs b/AutobusApi.Domain/Entities/Bus.cs index 3538c26..7075469 100644 --- a/AutobusApi.Domain/Entities/Bus.cs +++ b/AutobusApi.Domain/Entities/Bus.cs @@ -4,19 +4,19 @@ public class Bus : Vehicle { public Vehicle Vehicle { get; set; } = null!; - public required string Number { get; set; } + public string Number { get; set; } = null!; - public required string Model { get; set; } + public string Model { get; set; } = null!; - public required int Capacity { get; set; } + public int Capacity { get; set; } - public required bool HasClimateControl { get; set; } + public bool HasClimateControl { get; set; } - public required bool HasWC { get; set; } + public bool HasWC { get; set; } - public required bool HasWiFi { get; set; } + public bool HasWiFi { get; set; } - public required bool HasMultimedia { get; set; } + public bool HasMultimedia { get; set; } - public required bool HasOutlets { get; set; } + public bool HasOutlets { get; set; } } diff --git a/AutobusApi.Domain/Entities/Carriage.cs b/AutobusApi.Domain/Entities/Carriage.cs index d737a48..e1d1dcc 100644 --- a/AutobusApi.Domain/Entities/Carriage.cs +++ b/AutobusApi.Domain/Entities/Carriage.cs @@ -5,15 +5,15 @@ namespace AutobusApi.Domain.Entities; public class Carriage : EntityBase { - public required CarriageType Type { get; set; } + public CarriageType Type { get; set; } - public required int Capacity { get; set; } + public int Capacity { get; set; } - public required int Number { get; set; } + public int Number { get; set; } - public required bool HasWiFi { get; set; } + public bool HasWiFi { get; set; } - public required bool HasOutlets { get; set; } + public bool HasOutlets { get; set; } public ICollection TrainCarriage { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/City.cs b/AutobusApi.Domain/Entities/City.cs index ac50496..c7d5bb6 100644 --- a/AutobusApi.Domain/Entities/City.cs +++ b/AutobusApi.Domain/Entities/City.cs @@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities; public class City : EntityBase { - public required string Name { get; set; } + public string Name { get; set; } = null!; public ICollection
Addresses { get; set; } = null!; - public required int RegionId { get; set; } + public int RegionId { get; set; } public Region Region { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/Company.cs b/AutobusApi.Domain/Entities/Company.cs index 1ff4d97..3623f04 100644 --- a/AutobusApi.Domain/Entities/Company.cs +++ b/AutobusApi.Domain/Entities/Company.cs @@ -4,13 +4,13 @@ namespace AutobusApi.Domain.Entities; public class Company : EntityBase { - public required string Name { get; set; } + public string Name { get; set; } = null!; - public required string LegalAddress { get; set; } + public string LegalAddress { get; set; } = null!; - public required string ContactEmail { get; set; } + public string ContactEmail { get; set; } = null!; - public required string ContactPhoneNumber { get; set; } + public string ContactPhoneNumber { get; set; } = null!; public ICollection Vehicles { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/Country.cs b/AutobusApi.Domain/Entities/Country.cs index ddb860e..2b320cf 100644 --- a/AutobusApi.Domain/Entities/Country.cs +++ b/AutobusApi.Domain/Entities/Country.cs @@ -4,7 +4,7 @@ namespace AutobusApi.Domain.Entities; public class Country : EntityBase { - public required string Name { get; set; } + public string Name { get; set; } = null!; public ICollection Regions { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/Employee.cs b/AutobusApi.Domain/Entities/Employee.cs index 6e32101..e2f738e 100644 --- a/AutobusApi.Domain/Entities/Employee.cs +++ b/AutobusApi.Domain/Entities/Employee.cs @@ -5,17 +5,19 @@ namespace AutobusApi.Domain.Entities; public class Employee : EntityBase { - public required string FisrtName { get; set; } + public string FisrtName { get; set; } = null!; - public required string LastName { get; set; } + public string LastName { get; set; } = null!; - public required string Patronymic { get; set; } + public string Patronymic { get; set; } = null!; - public required Sex Sex { get; set; } + public Sex Sex { get; set; } - public required DateOnly BirthDate { get; set; } + public DateOnly BirthDate { get; set; } - public required int EmployerCompanyId { get; set; } + public int IdentityId { get; set; } + + public int EmployerCompanyId { get; set; } public Company EmployerCompany { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/EmployeeDocument.cs b/AutobusApi.Domain/Entities/EmployeeDocument.cs index 2fda8e5..d5c50dd 100644 --- a/AutobusApi.Domain/Entities/EmployeeDocument.cs +++ b/AutobusApi.Domain/Entities/EmployeeDocument.cs @@ -5,11 +5,11 @@ namespace AutobusApi.Domain.Entities; public class EmployeeDocument : EntityBase { - public required EmployeeDocumentType Type { get; set; } + public EmployeeDocumentType Type { get; set; } - public required string Information { get; set; } + public string Information { get; set; } = null!; - public required int EmployeeId { get; set; } + public int EmployeeId { get; set; } public Employee Employee { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/Region.cs b/AutobusApi.Domain/Entities/Region.cs index 6fc3d39..b0d7ed1 100644 --- a/AutobusApi.Domain/Entities/Region.cs +++ b/AutobusApi.Domain/Entities/Region.cs @@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities; public class Region : EntityBase { - public required string Name { get; set; } + public string Name { get; set; } = null!; public ICollection Cities { get; set; } = null!; - public required int CountryId { get; set; } + public int CountryId { get; set; } public Country Country { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/Review.cs b/AutobusApi.Domain/Entities/Review.cs index 485eace..4fa27c2 100644 --- a/AutobusApi.Domain/Entities/Review.cs +++ b/AutobusApi.Domain/Entities/Review.cs @@ -4,17 +4,17 @@ namespace AutobusApi.Domain.Entities; public class Review : EntityBase { - public required int Rating { get; set; } + public int Rating { get; set; } - public required string? Comment { get; set; } + public string? Comment { get; set; } - public required DateTime PostDateTimeUtc { get; set; } + public DateTime PostDateTimeUtc { get; set; } - public required int UserId { get; set; } + public int UserId { get; set; } public User User { get; set; } = null!; - public required int VehicleEnrollmentId { get; set; } + public int VehicleEnrollmentId { get; set; } public VehicleEnrollment VehicleEnrollment { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/RouteAddress.cs b/AutobusApi.Domain/Entities/RouteAddress.cs index 50b3bbe..344069f 100644 --- a/AutobusApi.Domain/Entities/RouteAddress.cs +++ b/AutobusApi.Domain/Entities/RouteAddress.cs @@ -4,13 +4,13 @@ namespace AutobusApi.Domain.Entities; public class RouteAddress : EntityBase { - public required int Order { get; set; } + public int Order { get; set; } - public required int AddressId { get; set; } + public int AddressId { get; set; } public Address Address { get; set; } = null!; - public required int RouteId { get; set; } + public int RouteId { get; set; } public Route Route { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/RouteAddressDetails.cs b/AutobusApi.Domain/Entities/RouteAddressDetails.cs index bcc73a8..49ba4ab 100644 --- a/AutobusApi.Domain/Entities/RouteAddressDetails.cs +++ b/AutobusApi.Domain/Entities/RouteAddressDetails.cs @@ -4,17 +4,17 @@ namespace AutobusApi.Domain.Entities; public class RouteAddressDetails : EntityBase { - public required TimeSpan TimeToNextAddress { get; set; } + public TimeSpan TimeToNextAddress { get; set; } - public required double CostToNextAddress { get; set; } + public double CostToNextAddress { get; set; } - public required TimeSpan CurrentAddressStopTime { get; set; } + public TimeSpan CurrentAddressStopTime { get; set; } - public required int RouteAddressId { get; set; } + public int RouteAddressId { get; set; } public RouteAddress RouteAddress { get; set; } = null!; - public required int VehicleEnrollmentId { get; set; } + public int VehicleEnrollmentId { get; set; } public VehicleEnrollment VehicleEnrollment { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/Ticket.cs b/AutobusApi.Domain/Entities/Ticket.cs index 03e7017..0c09e71 100644 --- a/AutobusApi.Domain/Entities/Ticket.cs +++ b/AutobusApi.Domain/Entities/Ticket.cs @@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities; public class Ticket : EntityBase { - public required int TicketGroupId { get; set; } + public int TicketGroupId { get; set; } public TicketGroup TicketGroup { get; set; } = null!; - public required int VehicleEnrollmentId { get; set; } + public int VehicleEnrollmentId { get; set; } public VehicleEnrollment VehicleEnrollment { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/TicketDocument.cs b/AutobusApi.Domain/Entities/TicketDocument.cs index 9500602..f1c4bbf 100644 --- a/AutobusApi.Domain/Entities/TicketDocument.cs +++ b/AutobusApi.Domain/Entities/TicketDocument.cs @@ -5,11 +5,11 @@ namespace AutobusApi.Domain.Entities; public class TicketDocument : EntityBase { - public required TicketDocumentType Type { get; set; } + public TicketDocumentType Type { get; set; } - public required string Information { get; set; } + public string Information { get; set; } = null!; - public required int TicketGroupId { get; set; } + public int TicketGroupId { get; set; } public TicketGroup TicketGroup { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/TicketGroup.cs b/AutobusApi.Domain/Entities/TicketGroup.cs index 00125b6..71cf18b 100644 --- a/AutobusApi.Domain/Entities/TicketGroup.cs +++ b/AutobusApi.Domain/Entities/TicketGroup.cs @@ -5,33 +5,33 @@ namespace AutobusApi.Domain.Entities; public class TicketGroup : EntityBase { - public required string BuyerFirstName { get; set; } + public string BuyerFirstName { get; set; } = null!; - public required string BuyerLastName { get; set; } + public string BuyerLastName { get; set; } = null!; - public required string BuyerPhoneNumber { get; set; } + public string BuyerPhoneNumber { get; set; } = null!; - public required string BuyerEmailAddress { get; set; } + public string BuyerEmailAddress { get; set; } = null!; - public required string PassengerFirstName { get; set; } + public string PassengerFirstName { get; set; } = null!; - public required string PassengerLastName { get; set; } + public string PassengerLastName { get; set; } = null!; - public required string PassengerPatronymic { get; set; } + public string PassengerPatronymic { get; set; } = null!; - public required Sex PassengerSex { get; set; } + public Sex PassengerSex { get; set; } - public required DateOnly PassengerBirthDate { get; set; } + public DateOnly PassengerBirthDate { get; set; } - public required DateTime PurchaseDateTimeUtc { get; set; } + public DateTime PurchaseDateTimeUtc { get; set; } - public required bool IsReturned { get; set; } + public bool IsReturned { get; set; } public int? UserId { get; set; } public User? User { get; set; } - public required int TicketDocumentId { get; set; } + public int TicketDocumentId { get; set; } public TicketDocument TicketDocument { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/Train.cs b/AutobusApi.Domain/Entities/Train.cs index f3a07ec..427dc01 100644 --- a/AutobusApi.Domain/Entities/Train.cs +++ b/AutobusApi.Domain/Entities/Train.cs @@ -4,7 +4,7 @@ public class Train : Vehicle { public Vehicle Vehicle { get; set; } = null!; - public required string Number { get; set; } + public string Number { get; set; } = null!; public ICollection TrainCarriage { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/TrainCarriage.cs b/AutobusApi.Domain/Entities/TrainCarriage.cs index cc41180..a33fd83 100644 --- a/AutobusApi.Domain/Entities/TrainCarriage.cs +++ b/AutobusApi.Domain/Entities/TrainCarriage.cs @@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities; public class TrainCarriage : EntityBase { - public required int TrainId { get; set; } + public int TrainId { get; set; } public Train Train { get; set; } = null!; - public required int CarriageId { get; set; } + public int CarriageId { get; set; } public Carriage Carriage { get; set; } = null!; } diff --git a/AutobusApi.Domain/Entities/User.cs b/AutobusApi.Domain/Entities/User.cs index 858f56f..9b13e29 100644 --- a/AutobusApi.Domain/Entities/User.cs +++ b/AutobusApi.Domain/Entities/User.cs @@ -4,6 +4,8 @@ namespace AutobusApi.Domain.Entities; public class User : EntityBase { + public int IdentityId { get; set; } + public ICollection TicketGroups { get; set; } = null!; public ICollection Reviews { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/Vehicle.cs b/AutobusApi.Domain/Entities/Vehicle.cs index 3bd58ac..ced2b19 100644 --- a/AutobusApi.Domain/Entities/Vehicle.cs +++ b/AutobusApi.Domain/Entities/Vehicle.cs @@ -4,7 +4,7 @@ namespace AutobusApi.Domain.Entities; public class Vehicle : EntityBase { - public required int CompanyId { get; set; } + public int CompanyId { get; set; } public Company Company { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/VehicleEnrollment.cs b/AutobusApi.Domain/Entities/VehicleEnrollment.cs index ebf9c71..895e8cd 100644 --- a/AutobusApi.Domain/Entities/VehicleEnrollment.cs +++ b/AutobusApi.Domain/Entities/VehicleEnrollment.cs @@ -4,13 +4,13 @@ namespace AutobusApi.Domain.Entities; public class VehicleEnrollment : EntityBase { - public required DateTime DepartureDateTimeUtc { get; set; } + public DateTime DepartureDateTimeUtc { get; set; } - public required int VehicleId { get; set; } + public int VehicleId { get; set; } public Vehicle Vehicle { get; set; } = null!; - public required int RouteId { get; set; } + public int RouteId { get; set; } public Route Route { get; set; } = null!; diff --git a/AutobusApi.Domain/Entities/VehicleEnrollmentEmployee.cs b/AutobusApi.Domain/Entities/VehicleEnrollmentEmployee.cs index 10271b7..a135a0a 100644 --- a/AutobusApi.Domain/Entities/VehicleEnrollmentEmployee.cs +++ b/AutobusApi.Domain/Entities/VehicleEnrollmentEmployee.cs @@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities; public class VehicleEnrollmentEmployee : EntityBase { - public required int EmployeeId { get; set; } + public int EmployeeId { get; set; } public Employee Employee { get; set; } = null!; - public required int VehicleEnrollmentId { get; set; } + public int VehicleEnrollmentId { get; set; } public VehicleEnrollment VehicleEnrollment { get; set; } = null!; } diff --git a/AutobusApi.Domain/Enums/IdentityRoles.cs b/AutobusApi.Domain/Enums/IdentityRoles.cs new file mode 100644 index 0000000..b5ddb1b --- /dev/null +++ b/AutobusApi.Domain/Enums/IdentityRoles.cs @@ -0,0 +1,6 @@ +namespace AutobusApi.Domain.Enums; + +public enum IdentityRoles +{ + User = 0 +}