Make amount, user_id and address_id optional in user order update
This commit is contained in:
@@ -6,19 +6,19 @@ public record UpdateUserOrderCommand : IRequest<Unit>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
//قیمت
|
||||
public long Amount { get; init; }
|
||||
public long? Amount { get; init; }
|
||||
//شناسه پکیج
|
||||
public long? PackageId { get; init; }
|
||||
//شناسه تراکنش
|
||||
public long? TransactionId { get; init; }
|
||||
//وضعیت پرداخت
|
||||
public PaymentStatus PaymentStatus { get; init; }
|
||||
public PaymentStatus? PaymentStatus { get; init; }
|
||||
//تاریخ پرداخت
|
||||
public DateTime? PaymentDate { get; init; }
|
||||
//شناسه کاربر
|
||||
public long UserId { get; init; }
|
||||
public long? UserId { get; init; }
|
||||
//شناسه آدرس کاربر
|
||||
public long UserAddressId { get; init; }
|
||||
public long? UserAddressId { get; init; }
|
||||
//
|
||||
public PaymentMethod? PaymentMethod { get; init; }
|
||||
// وضعیت ارسال سفارش
|
||||
|
||||
@@ -5,19 +5,19 @@ public class UpdateUserOrderCommandValidator : AbstractValidator<UpdateUserOrder
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Amount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.PackageId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.PaymentStatus)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserAddressId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.PaymentMethod)
|
||||
.IsInEnum();
|
||||
// RuleFor(model => model.Amount)
|
||||
// .NotNull();
|
||||
// RuleFor(model => model.PackageId)
|
||||
// .NotNull();
|
||||
// RuleFor(model => model.PaymentStatus)
|
||||
// .IsInEnum()
|
||||
// .NotNull();
|
||||
// RuleFor(model => model.UserId)
|
||||
// .NotNull();
|
||||
// RuleFor(model => model.UserAddressId)
|
||||
// .NotNull();
|
||||
// RuleFor(model => model.PaymentMethod)
|
||||
// .IsInEnum();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user