Skip to content

Commit

Permalink
added relation between trip and ticket payment
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriyBorkovich committed Apr 2, 2024
1 parent 3a2ab2b commit b621198
Show file tree
Hide file tree
Showing 6 changed files with 796 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/BSMS.Core/Entities/Ticket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public class Ticket
public Stop StartStop { get; set; } = null!;
public Stop EndStop { get; set; } = null!;
public Seat Seat { get; set; } = null!;
public TicketPayment Payment { get; set; } = null!;
public TicketPayment? Payment { get; set; } = null!;
}
13 changes: 9 additions & 4 deletions src/BSMS.Core/Entities/TicketPayment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

namespace BSMS.Core.Entities;

/// <summary>
/// represent already bought tickets
/// </summary>
public class TicketPayment
{
public int TicketPaymentId { get; set; }
public int PassengerId { get; set; }
public int TicketId { get; set;}
public int? PassengerId { get; set; }
public int? TicketId { get; set;}
public int TripId { get; set; }
public TicketStatus TicketStatus {get; set;}
public PaymentType PaymentType {get;set;}
public DateTime Date {get;set;}

public Passenger Passenger { get; set; }
public Ticket Ticket { get; set; }
public Passenger? Passenger { get; set; }
public Ticket? Ticket { get; set; }
public Trip Trip { get; set; }

Check warning on line 20 in src/BSMS.Core/Entities/TicketPayment.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Trip' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}
1 change: 1 addition & 0 deletions src/BSMS.Core/Entities/Trip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ public class Trip
public DateTime ArrivalTime { get; set; }

public BusScheduleEntry BusScheduleEntry { get; set; }

Check warning on line 15 in src/BSMS.Core/Entities/Trip.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'BusScheduleEntry' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public List<TicketPayment> BoughtTickets { get; set; }

Check warning on line 16 in src/BSMS.Core/Entities/Trip.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'BoughtTickets' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}
Loading

0 comments on commit b621198

Please sign in to comment.