Add delivery tracking fields to UserOrder entity
This commit is contained in:
@@ -71,7 +71,9 @@ public class
|
||||
PaymentDate = DateTime.Now,
|
||||
UserId = request.UserId,
|
||||
UserAddressId = user.UserAddresss.First(f => f.IsDefault).Id,
|
||||
TransactionId = newTransaction.Id
|
||||
TransactionId = newTransaction.Id,
|
||||
// سفارش فروشگاهی فیزیکی است، پس در ابتدا در انتظار ارسال است
|
||||
DeliveryStatus = DeliveryStatus.Pending
|
||||
};
|
||||
await _context.UserOrders.AddAsync(newOrder, cancellationToken);
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
@@ -92,4 +94,4 @@ public class
|
||||
};
|
||||
return finalResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,10 @@ public record UpdateUserOrderCommand : IRequest<Unit>
|
||||
public long UserAddressId { get; init; }
|
||||
//
|
||||
public PaymentMethod? PaymentMethod { get; init; }
|
||||
|
||||
}
|
||||
// وضعیت ارسال سفارش
|
||||
public DeliveryStatus? DeliveryStatus { get; init; }
|
||||
// کد رهگیری مرسوله
|
||||
public string? TrackingCode { get; init; }
|
||||
// توضیحات ارسال
|
||||
public string? DeliveryDescription { get; init; }
|
||||
}
|
||||
|
||||
@@ -30,4 +30,6 @@ public record GetAllUserOrderByFilterQuery : IRequest<GetAllUserOrderByFilterRes
|
||||
public long? UserAddressId { get; set; }
|
||||
//
|
||||
public PaymentMethod? PaymentMethod { get; set; }
|
||||
// وضعیت ارسال
|
||||
public DeliveryStatus? DeliveryStatus { get; set; }
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ public class GetAllUserOrderByFilterQueryHandler : IRequestHandler<GetAllUserOrd
|
||||
.Where(x => request.Filter.PaymentDate == null || x.PaymentDate == request.Filter.PaymentDate)
|
||||
.Where(x => request.Filter.UserId == null || x.UserId == request.Filter.UserId)
|
||||
.Where(x => request.Filter.UserAddressId == null || x.UserAddressId == request.Filter.UserAddressId)
|
||||
;
|
||||
.Where(x => request.Filter.PaymentMethod == null || x.PaymentMethod == request.Filter.PaymentMethod)
|
||||
.Where(x => request.Filter.DeliveryStatus == null || x.DeliveryStatus == request.Filter.DeliveryStatus);
|
||||
}
|
||||
return new GetAllUserOrderByFilterResponseDto
|
||||
{
|
||||
|
||||
@@ -32,6 +32,12 @@ public class GetAllUserOrderByFilterResponseDto
|
||||
public string? UserAddressText { get; set; }
|
||||
//
|
||||
public List<GetAllUserOrderByFilterResponseModelFactorDetail>? FactorDetails { get; set; }
|
||||
// وضعیت ارسال سفارش
|
||||
public DeliveryStatus DeliveryStatus { get; set; }
|
||||
// کد رهگیری مرسوله
|
||||
public string? TrackingCode { get; set; }
|
||||
// توضیحات ارسال
|
||||
public string? DeliveryDescription { get; set; }
|
||||
}
|
||||
public class GetAllUserOrderByFilterResponseModelFactorDetail
|
||||
{
|
||||
|
||||
@@ -25,6 +25,12 @@ public class GetUserOrderResponseDto
|
||||
public string? UserAddressText { get; set; }
|
||||
//
|
||||
public List<GetUserOrderResponseFactorDetail>? FactorDetails { get; set; }
|
||||
// وضعیت ارسال سفارش
|
||||
public DeliveryStatus DeliveryStatus { get; set; }
|
||||
// کد رهگیری مرسوله
|
||||
public string? TrackingCode { get; set; }
|
||||
// توضیحات ارسال
|
||||
public string? DeliveryDescription { get; set; }
|
||||
|
||||
}public class GetUserOrderResponseFactorDetail
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user