move entities

This commit is contained in:
cuqmbr 2023-11-15 18:57:51 +02:00
parent 8ad2bf637f
commit 2936cb59a4
Signed by: cuqmbr
GPG Key ID: 2D72ED98B6CB200F
23 changed files with 89 additions and 79 deletions

View File

@ -6,15 +6,15 @@ namespace AutobusApi.Domain.Entities;
public class Address : EntityBase 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<RouteAddress> RouteAddresses { get; set; } = null!; public ICollection<RouteAddress> RouteAddresses { get; set; } = null!;
public required int CityId { get; set; } public int CityId { get; set; }
public City City { get; set; } = null!; public City City { get; set; } = null!;
} }

View File

@ -4,13 +4,13 @@ public class Aircraft : Vehicle
{ {
public Vehicle Vehicle { get; set; } = null!; 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; }
} }

View File

@ -4,19 +4,19 @@ public class Bus : Vehicle
{ {
public Vehicle Vehicle { get; set; } = null!; 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; }
} }

View File

@ -5,15 +5,15 @@ namespace AutobusApi.Domain.Entities;
public class Carriage : EntityBase 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> TrainCarriage { get; set; } = null!; public ICollection<TrainCarriage> TrainCarriage { get; set; } = null!;
} }

View File

@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities;
public class City : EntityBase public class City : EntityBase
{ {
public required string Name { get; set; } public string Name { get; set; } = null!;
public ICollection<Address> Addresses { get; set; } = null!; public ICollection<Address> Addresses { get; set; } = null!;
public required int RegionId { get; set; } public int RegionId { get; set; }
public Region Region { get; set; } = null!; public Region Region { get; set; } = null!;
} }

View File

@ -4,13 +4,13 @@ namespace AutobusApi.Domain.Entities;
public class Company : EntityBase 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<Vehicle> Vehicles { get; set; } = null!; public ICollection<Vehicle> Vehicles { get; set; } = null!;

View File

@ -4,7 +4,7 @@ namespace AutobusApi.Domain.Entities;
public class Country : EntityBase public class Country : EntityBase
{ {
public required string Name { get; set; } public string Name { get; set; } = null!;
public ICollection<Region> Regions { get; set; } = null!; public ICollection<Region> Regions { get; set; } = null!;
} }

View File

@ -5,17 +5,19 @@ namespace AutobusApi.Domain.Entities;
public class Employee : EntityBase 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!; public Company EmployerCompany { get; set; } = null!;

View File

@ -5,11 +5,11 @@ namespace AutobusApi.Domain.Entities;
public class EmployeeDocument : EntityBase 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!; public Employee Employee { get; set; } = null!;
} }

View File

@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities;
public class Region : EntityBase public class Region : EntityBase
{ {
public required string Name { get; set; } public string Name { get; set; } = null!;
public ICollection<City> Cities { get; set; } = null!; public ICollection<City> Cities { get; set; } = null!;
public required int CountryId { get; set; } public int CountryId { get; set; }
public Country Country { get; set; } = null!; public Country Country { get; set; } = null!;
} }

View File

@ -4,17 +4,17 @@ namespace AutobusApi.Domain.Entities;
public class Review : EntityBase 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 User User { get; set; } = null!;
public required int VehicleEnrollmentId { get; set; } public int VehicleEnrollmentId { get; set; }
public VehicleEnrollment VehicleEnrollment { get; set; } = null!; public VehicleEnrollment VehicleEnrollment { get; set; } = null!;
} }

View File

@ -4,13 +4,13 @@ namespace AutobusApi.Domain.Entities;
public class RouteAddress : EntityBase 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 Address Address { get; set; } = null!;
public required int RouteId { get; set; } public int RouteId { get; set; }
public Route Route { get; set; } = null!; public Route Route { get; set; } = null!;

View File

@ -4,17 +4,17 @@ namespace AutobusApi.Domain.Entities;
public class RouteAddressDetails : EntityBase 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 RouteAddress RouteAddress { get; set; } = null!;
public required int VehicleEnrollmentId { get; set; } public int VehicleEnrollmentId { get; set; }
public VehicleEnrollment VehicleEnrollment { get; set; } = null!; public VehicleEnrollment VehicleEnrollment { get; set; } = null!;
} }

View File

@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities;
public class Ticket : EntityBase public class Ticket : EntityBase
{ {
public required int TicketGroupId { get; set; } public int TicketGroupId { get; set; }
public TicketGroup TicketGroup { get; set; } = null!; public TicketGroup TicketGroup { get; set; } = null!;
public required int VehicleEnrollmentId { get; set; } public int VehicleEnrollmentId { get; set; }
public VehicleEnrollment VehicleEnrollment { get; set; } = null!; public VehicleEnrollment VehicleEnrollment { get; set; } = null!;
} }

View File

@ -5,11 +5,11 @@ namespace AutobusApi.Domain.Entities;
public class TicketDocument : EntityBase 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!; public TicketGroup TicketGroup { get; set; } = null!;
} }

View File

@ -5,33 +5,33 @@ namespace AutobusApi.Domain.Entities;
public class TicketGroup : EntityBase 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 int? UserId { get; set; }
public User? User { get; set; } public User? User { get; set; }
public required int TicketDocumentId { get; set; } public int TicketDocumentId { get; set; }
public TicketDocument TicketDocument { get; set; } = null!; public TicketDocument TicketDocument { get; set; } = null!;

View File

@ -4,7 +4,7 @@ public class Train : Vehicle
{ {
public Vehicle Vehicle { get; set; } = null!; public Vehicle Vehicle { get; set; } = null!;
public required string Number { get; set; } public string Number { get; set; } = null!;
public ICollection<TrainCarriage> TrainCarriage { get; set; } = null!; public ICollection<TrainCarriage> TrainCarriage { get; set; } = null!;
} }

View File

@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities;
public class TrainCarriage : EntityBase public class TrainCarriage : EntityBase
{ {
public required int TrainId { get; set; } public int TrainId { get; set; }
public Train Train { get; set; } = null!; public Train Train { get; set; } = null!;
public required int CarriageId { get; set; } public int CarriageId { get; set; }
public Carriage Carriage { get; set; } = null!; public Carriage Carriage { get; set; } = null!;
} }

View File

@ -4,6 +4,8 @@ namespace AutobusApi.Domain.Entities;
public class User : EntityBase public class User : EntityBase
{ {
public int IdentityId { get; set; }
public ICollection<TicketGroup> TicketGroups { get; set; } = null!; public ICollection<TicketGroup> TicketGroups { get; set; } = null!;
public ICollection<Review> Reviews { get; set; } = null!; public ICollection<Review> Reviews { get; set; } = null!;

View File

@ -4,7 +4,7 @@ namespace AutobusApi.Domain.Entities;
public class Vehicle : EntityBase public class Vehicle : EntityBase
{ {
public required int CompanyId { get; set; } public int CompanyId { get; set; }
public Company Company { get; set; } = null!; public Company Company { get; set; } = null!;

View File

@ -4,13 +4,13 @@ namespace AutobusApi.Domain.Entities;
public class VehicleEnrollment : EntityBase 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 Vehicle Vehicle { get; set; } = null!;
public required int RouteId { get; set; } public int RouteId { get; set; }
public Route Route { get; set; } = null!; public Route Route { get; set; } = null!;

View File

@ -4,11 +4,11 @@ namespace AutobusApi.Domain.Entities;
public class VehicleEnrollmentEmployee : EntityBase public class VehicleEnrollmentEmployee : EntityBase
{ {
public required int EmployeeId { get; set; } public int EmployeeId { get; set; }
public Employee Employee { get; set; } = null!; public Employee Employee { get; set; } = null!;
public required int VehicleEnrollmentId { get; set; } public int VehicleEnrollmentId { get; set; }
public VehicleEnrollment VehicleEnrollment { get; set; } = null!; public VehicleEnrollment VehicleEnrollment { get; set; } = null!;
} }

View File

@ -0,0 +1,6 @@
namespace AutobusApi.Domain.Enums;
public enum IdentityRoles
{
User = 0
}