diff --git a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs index 847cf3b..dd536c6 100644 --- a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs +++ b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs @@ -6,19 +6,19 @@ public record UpdateUserOrderCommand : IRequest //شناسه 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; } // وضعیت ارسال سفارش diff --git a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs index d42f4c2..a30be47 100644 --- a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs +++ b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs @@ -5,19 +5,19 @@ public class UpdateUserOrderCommandValidator : AbstractValidator 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>> ValidateValue => async (model, propertyName) => { diff --git a/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj b/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj index 3cde81e..0a9e94e 100644 --- a/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj +++ b/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj @@ -3,7 +3,7 @@ net9.0 enable enable - 0.0.135 + 0.0.137 None False False diff --git a/src/CMSMicroservice.Protobuf/Protos/userorder.proto b/src/CMSMicroservice.Protobuf/Protos/userorder.proto index 1d4239b..b58a180 100644 --- a/src/CMSMicroservice.Protobuf/Protos/userorder.proto +++ b/src/CMSMicroservice.Protobuf/Protos/userorder.proto @@ -74,7 +74,7 @@ message CreateNewUserOrderResponse message UpdateUserOrderRequest { int64 id = 1; - int64 amount = 2; + google.protobuf.Int64Value amount = 2; google.protobuf.Int64Value package_id = 3; google.protobuf.Int64Value transaction_id = 4; oneof PaymentStatus_item @@ -82,8 +82,8 @@ message UpdateUserOrderRequest messages.PaymentStatus payment_status = 5; } google.protobuf.Timestamp payment_date = 6; - int64 user_id = 7; - int64 user_address_id = 8; + google.protobuf.Int64Value user_id = 7; + google.protobuf.Int64Value user_address_id = 8; oneof PaymentMethod_item { messages.PaymentMethod payment_method = 9; diff --git a/src/CMSMicroservice.WebApi/Common/Mappings/GeneralMapping.cs b/src/CMSMicroservice.WebApi/Common/Mappings/GeneralMapping.cs index 78fd50f..75ef23e 100644 --- a/src/CMSMicroservice.WebApi/Common/Mappings/GeneralMapping.cs +++ b/src/CMSMicroservice.WebApi/Common/Mappings/GeneralMapping.cs @@ -5,6 +5,7 @@ public class GeneralMapping : IRegister { void IRegister.Register(TypeAdapterConfig config) { + config.Default.IgnoreNullValues(true); config.NewConfig() .MapWith(src => decimal.Parse(src));