auto.bus_razor/TicketOffice/Models/Ticket.cs
cuqmbr c47d67b15d feat: places' availability depends on bought tickets
if cities in route you're searching for intersects with cities in the smb's ticket for the route, taken place will be unavailable and capacity in the search results will be decreased
2022-05-28 20:10:50 +03:00

33 lines
1.0 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace TicketOffice.Models;
public class Ticket
{
[Key]
public int Id { get; set; }
[Required(ErrorMessage = "Поле має бути заповненим")]
[Display(Name = "Ім'я пасажира")]
public string PassengerFirstName { get; set; }
[Required(ErrorMessage = "Поле має бути заповненим")]
[Display(Name = "Прізвище пасажира")]
public string PassengerLastName { get; set; }
[Required(ErrorMessage = "Поле має бути заповненим")]
[Display(Name = "Номер місця пасажира")]
public int PassengerPlace { get; set; }
[Required]
public ICollection<TicketCity> Cities { get; set; }
[ForeignKey("User")]
public int UserId { get; set; }
public User User { get; set; }
[ForeignKey("Route")]
public int RouteId { get; set; }
public Route Route { get; set; }
}