Skip to content

Commit

Permalink
Make Flight/FlightDetailsModel.cs properties nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyslav.mandryk committed Feb 12, 2024
1 parent 341df70 commit 8d5144f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ public async Task Run(DAL.Entities.Flight flight)
_flight = await Workflow.ExecuteActivityAsync((FlightActivities act) => act.MapFlightModel(flight),
_activityOptions);

await ChangeStatusAtTime(FlightStatus.CheckIn, _flight.Depart.Subtract(TimeSpan.FromDays(1)));
await ChangeStatusAtTime(FlightStatus.CheckIn, _flight.Depart.Value.Subtract(TimeSpan.FromDays(1)));

_flight = await Workflow.ExecuteActivityAsync((FlightActivities act) =>
act.AssignSeats(_flight), _activityOptions);

await ChangeStatusAtTime(FlightStatus.Boarding, _flight.Depart.Subtract(TimeSpan.FromHours(2)));
await ChangeStatusAtTime(FlightStatus.Boarding, _flight.Depart.Value.Subtract(TimeSpan.FromHours(2)));

await ChangeStatusAtTime(FlightStatus.Closed, _flight.Depart.Subtract(TimeSpan.FromMinutes(5)));
await ChangeStatusAtTime(FlightStatus.Closed, _flight.Depart.Value.Subtract(TimeSpan.FromMinutes(5)));

await ChangeStatusAtTime(FlightStatus.Departed, _flight.Depart);
await ChangeStatusAtTime(FlightStatus.Departed, _flight.Depart.Value);

await ChangeStatusAtTime(FlightStatus.Arrived, _flight.Arrival);
await ChangeStatusAtTime(FlightStatus.Arrived, _flight.Arrival.Value);

await Workflow.ExecuteActivityAsync((FlightActivities act) => act.SaveFlightDetails(_flight),
_activityOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class FlightDetailsModel

public string To { get; set; }

public DateTime Depart { get; set; }
public DateTime? Depart { get; set; }

public DateTime Arrival { get; set; }
public DateTime? Arrival { get; set; }

public decimal Price { get; set; }
public decimal? Price { get; set; }

public List<Seat> Seats { get; set; } = [];

Expand Down

0 comments on commit 8d5144f

Please sign in to comment.