Add cancel ride type code and the cancel reason

This commit is contained in:
2026-09-22 12:10:37 +05:30
parent 52845b5d87
commit d20e4a532f
6 changed files with 4156 additions and 1 deletions
+2
View File
@@ -13,6 +13,8 @@ public record RideResponse(
int Meterend,
DateTime? StartedAt,
DateTime? ClosedAt,
CancelRequestType? CancelTypeCode,
string? CancelReason,
DateTime CreatedAt);
public record CreateRideRequest(
+3 -1
View File
@@ -109,6 +109,8 @@ public class RideService(
throw new InvalidOperationException($"Cannot cancel a ride in {ride.Status} status");
ride.Status = RideStatus.Cancelled;
ride.CancelTypeCode = request.TypeCode;
ride.CancelReason = request.Reason;
await uow.BeginAsync(ct);
try { rideRepo.Update(ride); await uow.CommitAsync(ct); }
@@ -149,5 +151,5 @@ public class RideService(
r.FK_VehicleId, r.Vehicle?.NumberPlate ?? string.Empty,
r.FK_DriverProfileId, r.DriverProfile?.User?.FullName ?? string.Empty,
r.Meterstart, r.Meterend,
r.StartedAt, r.ClosedAt, r.CreatedAt);
r.StartedAt, r.ClosedAt, r.CancelTypeCode, r.CancelReason, r.CreatedAt);
}