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) =>
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.135</Version>
|
||||
<Version>0.0.137</Version>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,6 +5,7 @@ public class GeneralMapping : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.Default.IgnoreNullValues(true);
|
||||
config.NewConfig<string, decimal>()
|
||||
.MapWith(src => decimal.Parse(src));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user