diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommandValidator.cs b/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommandValidator.cs index e310b47..d135216 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommandValidator.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommandValidator.cs @@ -7,6 +7,8 @@ public class CreateNewTagCommandValidator : AbstractValidator model.Title) .NotEmpty(); + RuleFor(model => model.IsActive) + .NotNull(); RuleFor(model => model.SortOrder) .NotNull(); } @@ -18,4 +20,3 @@ public class CreateNewTagCommandValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommandValidator.cs b/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommandValidator.cs index b0981a4..4a78ac1 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommandValidator.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommandValidator.cs @@ -9,6 +9,8 @@ public class UpdateTagCommandValidator : AbstractValidator .NotEmpty(); RuleFor(model => model.Title) .NotEmpty(); + RuleFor(model => model.IsActive) + .NotNull(); RuleFor(model => model.SortOrder) .NotNull(); } @@ -20,4 +22,3 @@ public class UpdateTagCommandValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommand.cs b/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommand.cs index da14141..6a05eb6 100644 --- a/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommand.cs +++ b/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommand.cs @@ -1,49 +1,17 @@ -using CMSMicroservice.Domain.Enums; - namespace CMSMicroservice.Application.TransactionsCQ.Commands.CreateNewTransactions; public record CreateNewTransactionsCommand : IRequest { - // - public string MerchantId { get; init; } // public long Amount { get; init; } // - public string CallbackUrl { get; init; } - // public string Description { get; init; } // - public string? Mobile { get; init; } - // - public string? Email { get; init; } - // - public int? RequestStatusCode { get; init; } - // - public string? RequestStatusMessage { get; init; } - // - public string? Authority { get; init; } - // - public string? FeeType { get; init; } - // - public long? Fee { get; init; } - // - public int? Currency { get; init; } - // public PaymentStatus PaymentStatus { get; init; } //تاریخ پرداخت public DateTime? PaymentDate { get; init; } // - public int? VerificationStatusCode { get; init; } - // - public string? VerificationStatusMessage { get; init; } - // - public string? CardHash { get; init; } - // - public string? CardPan { get; init; } - // public string? RefId { get; init; } // - public string? OrderId { get; init; } - // public TransactionType Type { get; init; } } \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommandValidator.cs b/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommandValidator.cs index 8391ad0..dd4db3a 100644 --- a/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommandValidator.cs +++ b/src/CMSMicroservice.Application/TransactionsCQ/Commands/CreateNewTransactions/CreateNewTransactionsCommandValidator.cs @@ -3,12 +3,8 @@ public class CreateNewTransactionsCommandValidator : AbstractValidator model.MerchantId) - .NotEmpty(); RuleFor(model => model.Amount) .NotNull(); - RuleFor(model => model.CallbackUrl) - .NotEmpty(); RuleFor(model => model.Description) .NotEmpty(); RuleFor(model => model.PaymentStatus) diff --git a/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommand.cs b/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommand.cs index e326947..4af1f38 100644 --- a/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommand.cs +++ b/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommand.cs @@ -1,51 +1,19 @@ -using CMSMicroservice.Domain.Enums; - namespace CMSMicroservice.Application.TransactionsCQ.Commands.UpdateTransactions; public record UpdateTransactionsCommand : IRequest { // public long Id { get; init; } // - public string MerchantId { get; init; } - // public long Amount { get; init; } // - public string CallbackUrl { get; init; } - // public string Description { get; init; } // - public string? Mobile { get; init; } - // - public string? Email { get; init; } - // - public int? RequestStatusCode { get; init; } - // - public string? RequestStatusMessage { get; init; } - // - public string? Authority { get; init; } - // - public string? FeeType { get; init; } - // - public long? Fee { get; init; } - // - public int? Currency { get; init; } - // public PaymentStatus PaymentStatus { get; init; } //تاریخ پرداخت public DateTime? PaymentDate { get; init; } // - public int? VerificationStatusCode { get; init; } - // - public string? VerificationStatusMessage { get; init; } - // - public string? CardHash { get; init; } - // - public string? CardPan { get; init; } - // public string? RefId { get; init; } // - public string? OrderId { get; init; } - // public TransactionType Type { get; init; } } \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommandValidator.cs b/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommandValidator.cs index 05326ee..70d3476 100644 --- a/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommandValidator.cs +++ b/src/CMSMicroservice.Application/TransactionsCQ/Commands/UpdateTransactions/UpdateTransactionsCommandValidator.cs @@ -5,12 +5,8 @@ public class UpdateTransactionsCommandValidator : AbstractValidator model.Id) .NotNull(); - RuleFor(model => model.MerchantId) - .NotEmpty(); RuleFor(model => model.Amount) .NotNull(); - RuleFor(model => model.CallbackUrl) - .NotEmpty(); RuleFor(model => model.Description) .NotEmpty(); RuleFor(model => model.PaymentStatus) diff --git a/src/CMSMicroservice.Application/TransactionsCQ/Queries/GetAllTransactionsByFilter/GetAllTransactionsByFilterQuery.cs b/src/CMSMicroservice.Application/TransactionsCQ/Queries/GetAllTransactionsByFilter/GetAllTransactionsByFilterQuery.cs index 57bbe0b..2572ca4 100644 --- a/src/CMSMicroservice.Application/TransactionsCQ/Queries/GetAllTransactionsByFilter/GetAllTransactionsByFilterQuery.cs +++ b/src/CMSMicroservice.Application/TransactionsCQ/Queries/GetAllTransactionsByFilter/GetAllTransactionsByFilterQuery.cs @@ -1,5 +1,3 @@ -using CMSMicroservice.Domain.Enums; - namespace CMSMicroservice.Application.TransactionsCQ.Queries.GetAllTransactionsByFilter; public record GetAllTransactionsByFilterQuery : IRequest { @@ -15,45 +13,15 @@ public record GetAllTransactionsByFilterQuery : IRequest { //قیمت - public long Price { get; init; } + public long Amount { get; init; } //شناسه پکیج public long PackageId { get; init; } //شناسه تراکنش diff --git a/src/CMSMicroservice.Application/UserOrderCQ/Commands/CreateNewUserOrder/CreateNewUserOrderCommandValidator.cs b/src/CMSMicroservice.Application/UserOrderCQ/Commands/CreateNewUserOrder/CreateNewUserOrderCommandValidator.cs index ef37705..231bb6d 100644 --- a/src/CMSMicroservice.Application/UserOrderCQ/Commands/CreateNewUserOrder/CreateNewUserOrderCommandValidator.cs +++ b/src/CMSMicroservice.Application/UserOrderCQ/Commands/CreateNewUserOrder/CreateNewUserOrderCommandValidator.cs @@ -3,7 +3,7 @@ public class CreateNewUserOrderCommandValidator : AbstractValidator model.Price) + RuleFor(model => model.Amount) .NotNull(); RuleFor(model => model.PackageId) .NotNull(); diff --git a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs index ec2dda3..f413db1 100644 --- a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs +++ b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommand.cs @@ -1,12 +1,10 @@ -using CMSMicroservice.Domain.Enums; - namespace CMSMicroservice.Application.UserOrderCQ.Commands.UpdateUserOrder; public record UpdateUserOrderCommand : IRequest { //شناسه public long Id { get; init; } //قیمت - public long Price { get; init; } + public long Amount { get; init; } //شناسه پکیج public long PackageId { get; init; } //شناسه تراکنش diff --git a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs index 0d673fb..d42f4c2 100644 --- a/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs +++ b/src/CMSMicroservice.Application/UserOrderCQ/Commands/UpdateUserOrder/UpdateUserOrderCommandValidator.cs @@ -5,7 +5,7 @@ public class UpdateUserOrderCommandValidator : AbstractValidator model.Id) .NotNull(); - RuleFor(model => model.Price) + RuleFor(model => model.Amount) .NotNull(); RuleFor(model => model.PackageId) .NotNull(); diff --git a/src/CMSMicroservice.Application/UserOrderCQ/Queries/GetAllUserOrderByFilter/GetAllUserOrderByFilterQuery.cs b/src/CMSMicroservice.Application/UserOrderCQ/Queries/GetAllUserOrderByFilter/GetAllUserOrderByFilterQuery.cs index 5d58483..1afe770 100644 --- a/src/CMSMicroservice.Application/UserOrderCQ/Queries/GetAllUserOrderByFilter/GetAllUserOrderByFilterQuery.cs +++ b/src/CMSMicroservice.Application/UserOrderCQ/Queries/GetAllUserOrderByFilter/GetAllUserOrderByFilterQuery.cs @@ -1,5 +1,3 @@ -using CMSMicroservice.Domain.Enums; - namespace CMSMicroservice.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter; public record GetAllUserOrderByFilterQuery : IRequest { @@ -15,7 +13,7 @@ public record GetAllUserOrderByFilterQuery : IRequest { public void Configure(EntityTypeBuilder builder) @@ -12,19 +11,17 @@ public class CategoryConfiguration : IEntityTypeConfiguration builder.Ignore(entity => entity.DomainEvents); builder.HasKey(entity => entity.Id); builder.Property(entity => entity.Id).UseIdentityColumn(); - builder.Property(entity => entity.Name).IsRequired(true); builder.Property(entity => entity.Title).IsRequired(true); builder.Property(entity => entity.Description).IsRequired(false); builder.Property(entity => entity.ImagePath).IsRequired(false); - builder.Property(entity => entity.IsActive).IsRequired(true); - builder.Property(entity => entity.SortOrder).IsRequired(true); - builder .HasOne(entity => entity.Parent) .WithMany(entity => entity.Categorys) .HasForeignKey(entity => entity.ParentId) .IsRequired(false); + builder.Property(entity => entity.IsActive).IsRequired(true); + builder.Property(entity => entity.SortOrder).IsRequired(true); + } } - diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TransactionsConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TransactionsConfiguration.cs index e06308f..1087cf9 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TransactionsConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TransactionsConfiguration.cs @@ -11,30 +11,11 @@ public class TransactionsConfiguration : IEntityTypeConfiguration builder.Ignore(entity => entity.DomainEvents); builder.HasKey(entity => entity.Id); builder.Property(entity => entity.Id).UseIdentityColumn(); - builder.Property(entity => entity.MerchantId).IsRequired(true); builder.Property(entity => entity.Amount).IsRequired(true); - builder.Property(entity => entity.CallbackUrl).IsRequired(true); builder.Property(entity => entity.Description).IsRequired(true); - builder.Property(entity => entity.Mobile).IsRequired(false); - builder.Property(entity => entity.Email).IsRequired(false); - builder.Property(entity => entity.RequestStatusCode).IsRequired(false); - builder.Property(entity => entity.RequestStatusMessage).IsRequired(false); - builder.Property(entity => entity.Authority).IsRequired(false); - builder.Property(entity => entity.FeeType).IsRequired(false); - builder.Property(entity => entity.Fee).IsRequired(false); - builder.Property(entity => entity.Currency).IsRequired(false); builder.Property(entity => entity.PaymentStatus).IsRequired(true); builder.Property(entity => entity.PaymentDate).IsRequired(false); - builder.Property(entity => entity.VerificationStatusCode).IsRequired(false); - builder.Property(entity => entity.VerificationStatusMessage).IsRequired(false); - builder.Property(entity => entity.CardHash).IsRequired(false); - builder.Property(entity => entity.CardPan).IsRequired(false); builder.Property(entity => entity.RefId).IsRequired(false); - builder - .HasOne(entity => entity.Order) - .WithMany(entity => entity.Transactionss) - .HasForeignKey(entity => entity.OrderId) - .IsRequired(false); builder.Property(entity => entity.Type).IsRequired(true); } diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserOrderConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserOrderConfiguration.cs index 2545e2e..aea2a4e 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserOrderConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserOrderConfiguration.cs @@ -1,9 +1,8 @@ using CMSMicroservice.Domain.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; - namespace CMSMicroservice.Infrastructure.Persistence.Configurations; - +//سفارش کاربر public class UserOrderConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) @@ -12,12 +11,12 @@ public class UserOrderConfiguration : IEntityTypeConfiguration builder.Ignore(entity => entity.DomainEvents); builder.HasKey(entity => entity.Id); builder.Property(entity => entity.Id).UseIdentityColumn(); - builder.Property(entity => entity.Price).IsRequired(true); + builder.Property(entity => entity.Amount).IsRequired(true); builder .HasOne(entity => entity.Package) .WithMany(entity => entity.UserOrders) .HasForeignKey(entity => entity.PackageId) - .IsRequired(true); + .IsRequired(false); builder.Property(entity => entity.TransactionId).IsRequired(false); builder.Property(entity => entity.PaymentStatus).IsRequired(true); builder.Property(entity => entity.PaymentDate).IsRequired(false); @@ -30,7 +29,8 @@ public class UserOrderConfiguration : IEntityTypeConfiguration .HasOne(entity => entity.UserAddress) .WithMany(entity => entity.UserOrders) .HasForeignKey(entity => entity.UserAddressId) - .OnDelete(deleteBehavior: DeleteBehavior.Restrict) .IsRequired(true); + builder.Property(entity => entity.PaymentMethod).IsRequired(false); + } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Protobuf/Protos/tag.proto b/src/CMSMicroservice.Protobuf/Protos/tag.proto index 2de2bca..7b4f343 100644 --- a/src/CMSMicroservice.Protobuf/Protos/tag.proto +++ b/src/CMSMicroservice.Protobuf/Protos/tag.proto @@ -48,7 +48,7 @@ message CreateNewTagRequest { string name = 1; string title = 2; - string description = 3; + google.protobuf.StringValue description = 3; bool is_active = 4; int32 sort_order = 5; } @@ -61,7 +61,7 @@ message UpdateTagRequest int64 id = 1; string name = 2; string title = 3; - string description = 4; + google.protobuf.StringValue description = 4; bool is_active = 5; int32 sort_order = 6; } @@ -78,7 +78,7 @@ message GetTagResponse int64 id = 1; string name = 2; string title = 3; - string description = 4; + google.protobuf.StringValue description = 4; bool is_active = 5; int32 sort_order = 6; } @@ -107,8 +107,7 @@ message GetAllTagByFilterResponseModel int64 id = 1; string name = 2; string title = 3; - string description = 4; + google.protobuf.StringValue description = 4; bool is_active = 5; int32 sort_order = 6; } - diff --git a/src/CMSMicroservice.Protobuf/Protos/transactions.proto b/src/CMSMicroservice.Protobuf/Protos/transactions.proto index 8a31229..4052160 100644 --- a/src/CMSMicroservice.Protobuf/Protos/transactions.proto +++ b/src/CMSMicroservice.Protobuf/Protos/transactions.proto @@ -46,32 +46,17 @@ service TransactionsContract } message CreateNewTransactionsRequest { - string merchant_id = 1; - int64 amount = 2; - string callback_url = 3; - string description = 4; - google.protobuf.StringValue mobile = 5; - google.protobuf.StringValue email = 6; - google.protobuf.Int32Value request_status_code = 7; - google.protobuf.StringValue request_status_message = 8; - google.protobuf.StringValue authority = 9; - google.protobuf.StringValue fee_type = 10; - google.protobuf.Int64Value fee = 11; - google.protobuf.Int32Value currency = 12; + int64 amount = 1; + string description = 2; oneof PaymentStatus_item { - messages.PaymentStatus payment_status = 13; + messages.PaymentStatus payment_status = 3; } - google.protobuf.Timestamp payment_date = 14; - google.protobuf.Int32Value verification_status_code = 15; - google.protobuf.StringValue verification_status_message = 16; - google.protobuf.StringValue card_hash = 17; - google.protobuf.StringValue card_pan = 18; - google.protobuf.StringValue ref_id = 19; - google.protobuf.StringValue order_id = 20; + google.protobuf.Timestamp payment_date = 4; + google.protobuf.StringValue ref_id = 5; oneof Type_item { - messages.TransactionType type = 21; + messages.TransactionType type = 6; } } message CreateNewTransactionsResponse @@ -81,32 +66,17 @@ message CreateNewTransactionsResponse message UpdateTransactionsRequest { int64 id = 1; - string merchant_id = 2; - int64 amount = 3; - string callback_url = 4; - string description = 5; - google.protobuf.StringValue mobile = 6; - google.protobuf.StringValue email = 7; - google.protobuf.Int32Value request_status_code = 8; - google.protobuf.StringValue request_status_message = 9; - google.protobuf.StringValue authority = 10; - google.protobuf.StringValue fee_type = 11; - google.protobuf.Int64Value fee = 12; - google.protobuf.Int32Value currency = 13; + int64 amount = 2; + string description = 3; oneof PaymentStatus_item { - messages.PaymentStatus payment_status = 14; + messages.PaymentStatus payment_status = 4; } - google.protobuf.Timestamp payment_date = 15; - google.protobuf.Int32Value verification_status_code = 16; - google.protobuf.StringValue verification_status_message = 17; - google.protobuf.StringValue card_hash = 18; - google.protobuf.StringValue card_pan = 19; - google.protobuf.StringValue ref_id = 20; - google.protobuf.StringValue order_id = 21; + google.protobuf.Timestamp payment_date = 5; + google.protobuf.StringValue ref_id = 6; oneof Type_item { - messages.TransactionType type = 22; + messages.TransactionType type = 7; } } message DeleteTransactionsRequest @@ -120,32 +90,17 @@ message GetTransactionsRequest message GetTransactionsResponse { int64 id = 1; - string merchant_id = 2; - int64 amount = 3; - string callback_url = 4; - string description = 5; - google.protobuf.StringValue mobile = 6; - google.protobuf.StringValue email = 7; - google.protobuf.Int32Value request_status_code = 8; - google.protobuf.StringValue request_status_message = 9; - google.protobuf.StringValue authority = 10; - google.protobuf.StringValue fee_type = 11; - google.protobuf.Int64Value fee = 12; - google.protobuf.Int32Value currency = 13; + int64 amount = 2; + string description = 3; oneof PaymentStatus_item { - messages.PaymentStatus payment_status = 14; + messages.PaymentStatus payment_status = 4; } - google.protobuf.Timestamp payment_date = 15; - google.protobuf.Int32Value verification_status_code = 16; - google.protobuf.StringValue verification_status_message = 17; - google.protobuf.StringValue card_hash = 18; - google.protobuf.StringValue card_pan = 19; - google.protobuf.StringValue ref_id = 20; - google.protobuf.StringValue order_id = 21; + google.protobuf.Timestamp payment_date = 5; + google.protobuf.StringValue ref_id = 6; oneof Type_item { - messages.TransactionType type = 22; + messages.TransactionType type = 7; } } message GetAllTransactionsByFilterRequest @@ -157,32 +112,17 @@ message GetAllTransactionsByFilterRequest message GetAllTransactionsByFilterFilter { google.protobuf.Int64Value id = 1; - google.protobuf.StringValue merchant_id = 2; - google.protobuf.Int64Value amount = 3; - google.protobuf.StringValue callback_url = 4; - google.protobuf.StringValue description = 5; - google.protobuf.StringValue mobile = 6; - google.protobuf.StringValue email = 7; - google.protobuf.Int32Value request_status_code = 8; - google.protobuf.StringValue request_status_message = 9; - google.protobuf.StringValue authority = 10; - google.protobuf.StringValue fee_type = 11; - google.protobuf.Int64Value fee = 12; - google.protobuf.Int32Value currency = 13; + google.protobuf.Int64Value amount = 2; + google.protobuf.StringValue description = 3; oneof PaymentStatus_item { - messages.PaymentStatus payment_status = 14; + messages.PaymentStatus payment_status = 4; } - google.protobuf.Timestamp payment_date = 15; - google.protobuf.Int32Value verification_status_code = 16; - google.protobuf.StringValue verification_status_message = 17; - google.protobuf.StringValue card_hash = 18; - google.protobuf.StringValue card_pan = 19; - google.protobuf.StringValue ref_id = 20; - google.protobuf.Int64Value order_id = 21; + google.protobuf.Timestamp payment_date = 5; + google.protobuf.StringValue ref_id = 6; oneof Type_item { - messages.TransactionType type = 22; + messages.TransactionType type = 7; } } message GetAllTransactionsByFilterResponse @@ -193,31 +133,16 @@ message GetAllTransactionsByFilterResponse message GetAllTransactionsByFilterResponseModel { int64 id = 1; - string merchant_id = 2; - int64 amount = 3; - string callback_url = 4; - string description = 5; - google.protobuf.StringValue mobile = 6; - google.protobuf.StringValue email = 7; - google.protobuf.Int32Value request_status_code = 8; - google.protobuf.StringValue request_status_message = 9; - google.protobuf.StringValue authority = 10; - google.protobuf.StringValue fee_type = 11; - google.protobuf.Int64Value fee = 12; - google.protobuf.Int32Value currency = 13; + int64 amount = 2; + string description = 3; oneof PaymentStatus_item { - messages.PaymentStatus payment_status = 14; + messages.PaymentStatus payment_status = 4; } - google.protobuf.Timestamp payment_date = 15; - google.protobuf.Int32Value verification_status_code = 16; - google.protobuf.StringValue verification_status_message = 17; - google.protobuf.StringValue card_hash = 18; - google.protobuf.StringValue card_pan = 19; - google.protobuf.StringValue ref_id = 20; - google.protobuf.StringValue order_id = 21; + google.protobuf.Timestamp payment_date = 5; + google.protobuf.StringValue ref_id = 6; oneof Type_item { - messages.TransactionType type = 22; + messages.TransactionType type = 7; } } diff --git a/src/CMSMicroservice.Protobuf/Protos/userorder.proto b/src/CMSMicroservice.Protobuf/Protos/userorder.proto index fb7a183..6049095 100644 --- a/src/CMSMicroservice.Protobuf/Protos/userorder.proto +++ b/src/CMSMicroservice.Protobuf/Protos/userorder.proto @@ -52,7 +52,7 @@ service UserOrderContract } message CreateNewUserOrderRequest { - int64 price = 1; + int64 amount = 1; int64 package_id = 2; google.protobuf.Int64Value transaction_id = 3; oneof PaymentStatus_item @@ -74,7 +74,7 @@ message CreateNewUserOrderResponse message UpdateUserOrderRequest { int64 id = 1; - int64 price = 2; + int64 amount = 2; int64 package_id = 3; google.protobuf.Int64Value transaction_id = 4; oneof PaymentStatus_item @@ -100,7 +100,7 @@ message GetUserOrderRequest message GetUserOrderResponse { int64 id = 1; - int64 price = 2; + int64 amount = 2; int64 package_id = 3; google.protobuf.Int64Value transaction_id = 4; oneof PaymentStatus_item @@ -126,7 +126,7 @@ message GetAllUserOrderByFilterRequest message GetAllUserOrderByFilterFilter { google.protobuf.Int64Value id = 1; - google.protobuf.Int64Value price = 2; + google.protobuf.Int64Value amount = 2; google.protobuf.Int64Value package_id = 3; google.protobuf.Int64Value transaction_id = 4; oneof PaymentStatus_item @@ -149,7 +149,7 @@ message GetAllUserOrderByFilterResponse message GetAllUserOrderByFilterResponseModel { int64 id = 1; - int64 price = 2; + int64 amount = 2; int64 package_id = 3; google.protobuf.Int64Value transaction_id = 4; oneof PaymentStatus_item diff --git a/src/CMSMicroservice.Protobuf/Validator/Tag/CreateNewTagRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Tag/CreateNewTagRequestValidator.cs index 0e6dd0a..3a4fd79 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Tag/CreateNewTagRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Tag/CreateNewTagRequestValidator.cs @@ -10,6 +10,8 @@ public class CreateNewTagRequestValidator : AbstractValidator model.Title) .NotEmpty(); + RuleFor(model => model.IsActive) + .NotNull(); RuleFor(model => model.SortOrder) .NotNull(); } @@ -21,4 +23,3 @@ public class CreateNewTagRequestValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/Tag/UpdateTagRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Tag/UpdateTagRequestValidator.cs index 47aacc4..1968284 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Tag/UpdateTagRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Tag/UpdateTagRequestValidator.cs @@ -12,6 +12,8 @@ public class UpdateTagRequestValidator : AbstractValidator .NotEmpty(); RuleFor(model => model.Title) .NotEmpty(); + RuleFor(model => model.IsActive) + .NotNull(); RuleFor(model => model.SortOrder) .NotNull(); } @@ -23,4 +25,3 @@ public class UpdateTagRequestValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/Transactions/CreateNewTransactionsRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Transactions/CreateNewTransactionsRequestValidator.cs index 7314a5c..db4cf6a 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Transactions/CreateNewTransactionsRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Transactions/CreateNewTransactionsRequestValidator.cs @@ -6,12 +6,8 @@ public class CreateNewTransactionsRequestValidator : AbstractValidator model.MerchantId) - .NotEmpty(); RuleFor(model => model.Amount) .NotNull(); - RuleFor(model => model.CallbackUrl) - .NotEmpty(); RuleFor(model => model.Description) .NotEmpty(); RuleFor(model => model.PaymentStatus) diff --git a/src/CMSMicroservice.Protobuf/Validator/Transactions/UpdateTransactionsRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Transactions/UpdateTransactionsRequestValidator.cs index 23456f7..a277596 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Transactions/UpdateTransactionsRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Transactions/UpdateTransactionsRequestValidator.cs @@ -8,12 +8,8 @@ public class UpdateTransactionsRequestValidator : AbstractValidator model.Id) .NotNull(); - RuleFor(model => model.MerchantId) - .NotEmpty(); RuleFor(model => model.Amount) .NotNull(); - RuleFor(model => model.CallbackUrl) - .NotEmpty(); RuleFor(model => model.Description) .NotEmpty(); RuleFor(model => model.PaymentStatus) diff --git a/src/CMSMicroservice.Protobuf/Validator/UserOrder/CreateNewUserOrderRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/UserOrder/CreateNewUserOrderRequestValidator.cs index 03b8137..a8a2cf6 100644 --- a/src/CMSMicroservice.Protobuf/Validator/UserOrder/CreateNewUserOrderRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/UserOrder/CreateNewUserOrderRequestValidator.cs @@ -6,7 +6,7 @@ public class CreateNewUserOrderRequestValidator : AbstractValidator model.Price) + RuleFor(model => model.Amount) .NotNull(); RuleFor(model => model.PackageId) .NotNull(); diff --git a/src/CMSMicroservice.Protobuf/Validator/UserOrder/UpdateUserOrderRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/UserOrder/UpdateUserOrderRequestValidator.cs index f1d64f1..4c40af0 100644 --- a/src/CMSMicroservice.Protobuf/Validator/UserOrder/UpdateUserOrderRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/UserOrder/UpdateUserOrderRequestValidator.cs @@ -8,7 +8,7 @@ public class UpdateUserOrderRequestValidator : AbstractValidator model.Id) .NotNull(); - RuleFor(model => model.Price) + RuleFor(model => model.Amount) .NotNull(); RuleFor(model => model.PackageId) .NotNull();