Generator Changes at 11/12/2025 1:32:03 AM +03:30
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
@@ -10,27 +9,33 @@
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<PackageId>Foursat.CMSMicroservice.Protobuf</PackageId>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
|
||||
<PackageReference Include="Grpc.Core.Api" Version="2.54.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.55.1">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
|
||||
<PackageReference Include="Google.Api.CommonProtos" Version="2.10.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.55.1" >
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="Protos\user.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\useraddress.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\public_messages.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\package.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\userorder.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\role.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\userrole.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\otptoken.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\public_messages.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\user.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\useraddress.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\userwallet.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\userwalletchangelog.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\usercarts.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\productgallerys.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\factordetails.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\products.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\productimages.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\transactions.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PushToFoursatNuget" AfterTargets="Pack">
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package factordetails;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.FactorDetails";
|
||||
|
||||
service FactorDetailsContract
|
||||
{
|
||||
rpc CreateNewFactorDetails(CreateNewFactorDetailsRequest) returns (CreateNewFactorDetailsResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewFactorDetails"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateFactorDetails(UpdateFactorDetailsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateFactorDetails"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteFactorDetails(DeleteFactorDetailsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteFactorDetails"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetFactorDetails(GetFactorDetailsRequest) returns (GetFactorDetailsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetFactorDetails"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllFactorDetailsByFilter(GetAllFactorDetailsByFilterRequest) returns (GetAllFactorDetailsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllFactorDetailsByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewFactorDetailsRequest
|
||||
{
|
||||
int64 product_id = 1;
|
||||
int32 count = 2;
|
||||
int64 unit_price = 3;
|
||||
int32 unit_discount = 4;
|
||||
int64 order_id = 5;
|
||||
int64 unit_discount_price = 6;
|
||||
bool is_change_price = 7;
|
||||
}
|
||||
message CreateNewFactorDetailsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateFactorDetailsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int32 count = 3;
|
||||
int64 unit_price = 4;
|
||||
int32 unit_discount = 5;
|
||||
int64 order_id = 6;
|
||||
int64 unit_discount_price = 7;
|
||||
bool is_change_price = 8;
|
||||
}
|
||||
message DeleteFactorDetailsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetFactorDetailsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetFactorDetailsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int32 count = 3;
|
||||
int64 unit_price = 4;
|
||||
int32 unit_discount = 5;
|
||||
int64 order_id = 6;
|
||||
int64 unit_discount_price = 7;
|
||||
bool is_change_price = 8;
|
||||
}
|
||||
message GetAllFactorDetailsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllFactorDetailsByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllFactorDetailsByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value product_id = 2;
|
||||
google.protobuf.Int32Value count = 3;
|
||||
google.protobuf.Int64Value unit_price = 4;
|
||||
google.protobuf.Int32Value unit_discount = 5;
|
||||
google.protobuf.Int64Value order_id = 6;
|
||||
google.protobuf.Int64Value unit_discount_price = 7;
|
||||
google.protobuf.BoolValue is_change_price = 8;
|
||||
}
|
||||
message GetAllFactorDetailsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllFactorDetailsByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllFactorDetailsByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int32 count = 3;
|
||||
int64 unit_price = 4;
|
||||
int32 unit_discount = 5;
|
||||
int64 order_id = 6;
|
||||
int64 unit_discount_price = 7;
|
||||
bool is_change_price = 8;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package productgallerys;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.ProductGallerys";
|
||||
|
||||
service ProductGallerysContract
|
||||
{
|
||||
rpc CreateNewProductGallerys(CreateNewProductGallerysRequest) returns (CreateNewProductGallerysResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewProductGallerys"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateProductGallerys(UpdateProductGallerysRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateProductGallerys"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteProductGallerys(DeleteProductGallerysRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteProductGallerys"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetProductGallerys(GetProductGallerysRequest) returns (GetProductGallerysResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetProductGallerys"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllProductGallerysByFilter(GetAllProductGallerysByFilterRequest) returns (GetAllProductGallerysByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllProductGallerysByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewProductGallerysRequest
|
||||
{
|
||||
int64 product_image_id = 1;
|
||||
int64 product_id = 2;
|
||||
}
|
||||
message CreateNewProductGallerysResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateProductGallerysRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_image_id = 2;
|
||||
int64 product_id = 3;
|
||||
}
|
||||
message DeleteProductGallerysRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetProductGallerysRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetProductGallerysResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_image_id = 2;
|
||||
int64 product_id = 3;
|
||||
}
|
||||
message GetAllProductGallerysByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllProductGallerysByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllProductGallerysByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value product_image_id = 2;
|
||||
google.protobuf.Int64Value product_id = 3;
|
||||
}
|
||||
message GetAllProductGallerysByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllProductGallerysByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllProductGallerysByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_image_id = 2;
|
||||
int64 product_id = 3;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package productimages;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.ProductImages";
|
||||
|
||||
service ProductImagesContract
|
||||
{
|
||||
rpc CreateNewProductImages(CreateNewProductImagesRequest) returns (CreateNewProductImagesResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewProductImages"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateProductImages(UpdateProductImagesRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateProductImages"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteProductImages(DeleteProductImagesRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteProductImages"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetProductImages(GetProductImagesRequest) returns (GetProductImagesResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetProductImages"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllProductImagesByFilter(GetAllProductImagesByFilterRequest) returns (GetAllProductImagesByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllProductImagesByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewProductImagesRequest
|
||||
{
|
||||
string title = 1;
|
||||
string image_path = 2;
|
||||
string image_thumbnail_path = 3;
|
||||
}
|
||||
message CreateNewProductImagesResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateProductImagesRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string image_path = 3;
|
||||
string image_thumbnail_path = 4;
|
||||
}
|
||||
message DeleteProductImagesRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetProductImagesRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetProductImagesResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string image_path = 3;
|
||||
string image_thumbnail_path = 4;
|
||||
}
|
||||
message GetAllProductImagesByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllProductImagesByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllProductImagesByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.StringValue title = 2;
|
||||
google.protobuf.StringValue image_path = 3;
|
||||
google.protobuf.StringValue image_thumbnail_path = 4;
|
||||
}
|
||||
message GetAllProductImagesByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllProductImagesByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllProductImagesByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string image_path = 3;
|
||||
string image_thumbnail_path = 4;
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package products;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.Products";
|
||||
|
||||
service ProductsContract
|
||||
{
|
||||
rpc CreateNewProducts(CreateNewProductsRequest) returns (CreateNewProductsResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewProducts"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateProducts(UpdateProductsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateProducts"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteProducts(DeleteProductsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteProducts"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetProducts(GetProductsRequest) returns (GetProductsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetProducts"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllProductsByFilter(GetAllProductsByFilterRequest) returns (GetAllProductsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllProductsByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewProductsRequest
|
||||
{
|
||||
string title = 1;
|
||||
string description = 2;
|
||||
string short_infomation = 3;
|
||||
string full_information = 4;
|
||||
int64 price = 5;
|
||||
int32 discount = 6;
|
||||
int32 rate = 7;
|
||||
string image_path = 8;
|
||||
string thumbnail_path = 9;
|
||||
int32 sale_count = 10;
|
||||
int32 view_count = 11;
|
||||
int32 remaining_count = 12;
|
||||
}
|
||||
message CreateNewProductsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateProductsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string short_infomation = 4;
|
||||
string full_information = 5;
|
||||
int64 price = 6;
|
||||
int32 discount = 7;
|
||||
int32 rate = 8;
|
||||
string image_path = 9;
|
||||
string thumbnail_path = 10;
|
||||
int32 sale_count = 11;
|
||||
int32 view_count = 12;
|
||||
int32 remaining_count = 13;
|
||||
}
|
||||
message DeleteProductsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetProductsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetProductsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string short_infomation = 4;
|
||||
string full_information = 5;
|
||||
int64 price = 6;
|
||||
int32 discount = 7;
|
||||
int32 rate = 8;
|
||||
string image_path = 9;
|
||||
string thumbnail_path = 10;
|
||||
int32 sale_count = 11;
|
||||
int32 view_count = 12;
|
||||
int32 remaining_count = 13;
|
||||
}
|
||||
message GetAllProductsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllProductsByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllProductsByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.StringValue title = 2;
|
||||
google.protobuf.StringValue description = 3;
|
||||
google.protobuf.StringValue short_infomation = 4;
|
||||
google.protobuf.StringValue full_information = 5;
|
||||
google.protobuf.Int64Value price = 6;
|
||||
google.protobuf.Int32Value discount = 7;
|
||||
google.protobuf.Int32Value rate = 8;
|
||||
google.protobuf.StringValue image_path = 9;
|
||||
google.protobuf.StringValue thumbnail_path = 10;
|
||||
google.protobuf.Int32Value sale_count = 11;
|
||||
google.protobuf.Int32Value view_count = 12;
|
||||
google.protobuf.Int32Value remaining_count = 13;
|
||||
}
|
||||
message GetAllProductsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllProductsByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllProductsByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string short_infomation = 4;
|
||||
string full_information = 5;
|
||||
int64 price = 6;
|
||||
int32 discount = 7;
|
||||
int32 rate = 8;
|
||||
string image_path = 9;
|
||||
string thumbnail_path = 10;
|
||||
int32 sale_count = 11;
|
||||
int32 view_count = 12;
|
||||
int32 remaining_count = 13;
|
||||
}
|
||||
@@ -31,3 +31,16 @@ message DecimalValue
|
||||
|
||||
sfixed32 nanos = 2;
|
||||
}
|
||||
enum PaymentStatus
|
||||
{
|
||||
Success = 0;
|
||||
Reject = 1;
|
||||
Pending = 2;
|
||||
}
|
||||
enum TransactionType
|
||||
{
|
||||
Buy = 0;
|
||||
DepositIpg = 1;
|
||||
DepositExternal1 = 2;
|
||||
Withdraw = 3;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package transactions;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.Transactions";
|
||||
|
||||
service TransactionsContract
|
||||
{
|
||||
rpc CreateNewTransactions(CreateNewTransactionsRequest) returns (CreateNewTransactionsResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewTransactions"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateTransactions(UpdateTransactionsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateTransactions"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteTransactions(DeleteTransactionsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteTransactions"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetTransactions(GetTransactionsRequest) returns (GetTransactionsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetTransactions"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllTransactionsByFilter(GetAllTransactionsByFilterRequest) returns (GetAllTransactionsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllTransactionsByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
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;
|
||||
oneof PaymentStatus_item
|
||||
{
|
||||
messages.PaymentStatus payment_status = 13;
|
||||
}
|
||||
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;
|
||||
oneof Type_item
|
||||
{
|
||||
messages.TransactionType type = 21;
|
||||
}
|
||||
}
|
||||
message CreateNewTransactionsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
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;
|
||||
oneof PaymentStatus_item
|
||||
{
|
||||
messages.PaymentStatus payment_status = 14;
|
||||
}
|
||||
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;
|
||||
oneof Type_item
|
||||
{
|
||||
messages.TransactionType type = 22;
|
||||
}
|
||||
}
|
||||
message DeleteTransactionsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetTransactionsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
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;
|
||||
oneof PaymentStatus_item
|
||||
{
|
||||
messages.PaymentStatus payment_status = 14;
|
||||
}
|
||||
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;
|
||||
oneof Type_item
|
||||
{
|
||||
messages.TransactionType type = 22;
|
||||
}
|
||||
}
|
||||
message GetAllTransactionsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllTransactionsByFilterFilter filter = 3;
|
||||
}
|
||||
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;
|
||||
oneof PaymentStatus_item
|
||||
{
|
||||
messages.PaymentStatus payment_status = 14;
|
||||
}
|
||||
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;
|
||||
oneof Type_item
|
||||
{
|
||||
messages.TransactionType type = 22;
|
||||
}
|
||||
}
|
||||
message GetAllTransactionsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllTransactionsByFilterResponseModel models = 2;
|
||||
}
|
||||
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;
|
||||
oneof PaymentStatus_item
|
||||
{
|
||||
messages.PaymentStatus payment_status = 14;
|
||||
}
|
||||
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;
|
||||
oneof Type_item
|
||||
{
|
||||
messages.TransactionType type = 22;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package usercarts;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.UserCarts";
|
||||
|
||||
service UserCartsContract
|
||||
{
|
||||
rpc CreateNewUserCarts(CreateNewUserCartsRequest) returns (CreateNewUserCartsResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewUserCarts"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateUserCarts(UpdateUserCartsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateUserCarts"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteUserCarts(DeleteUserCartsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteUserCarts"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetUserCarts(GetUserCartsRequest) returns (GetUserCartsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetUserCarts"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllUserCartsByFilter(GetAllUserCartsByFilterRequest) returns (GetAllUserCartsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllUserCartsByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserCartsRequest
|
||||
{
|
||||
int64 product_id = 1;
|
||||
int64 user_id = 2;
|
||||
int32 count = 3;
|
||||
}
|
||||
message CreateNewUserCartsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateUserCartsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int64 user_id = 3;
|
||||
int32 count = 4;
|
||||
}
|
||||
message DeleteUserCartsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserCartsRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserCartsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int64 user_id = 3;
|
||||
int32 count = 4;
|
||||
}
|
||||
message GetAllUserCartsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllUserCartsByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllUserCartsByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value product_id = 2;
|
||||
google.protobuf.Int64Value user_id = 3;
|
||||
google.protobuf.Int32Value count = 4;
|
||||
}
|
||||
message GetAllUserCartsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllUserCartsByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllUserCartsByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int64 user_id = 3;
|
||||
int32 count = 4;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package userwallet;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.UserWallet";
|
||||
|
||||
service UserWalletContract
|
||||
{
|
||||
rpc CreateNewUserWallet(CreateNewUserWalletRequest) returns (CreateNewUserWalletResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewUserWallet"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateUserWallet(UpdateUserWalletRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateUserWallet"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteUserWallet(DeleteUserWalletRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteUserWallet"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetUserWallet(GetUserWalletRequest) returns (GetUserWalletResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetUserWallet"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllUserWalletByFilter(GetAllUserWalletByFilterRequest) returns (GetAllUserWalletByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllUserWalletByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserWalletRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
int64 balance = 2;
|
||||
}
|
||||
message CreateNewUserWalletResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateUserWalletRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 balance = 3;
|
||||
}
|
||||
message DeleteUserWalletRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserWalletRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserWalletResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 balance = 3;
|
||||
}
|
||||
message GetAllUserWalletByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllUserWalletByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllUserWalletByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value user_id = 2;
|
||||
google.protobuf.Int64Value balance = 3;
|
||||
}
|
||||
message GetAllUserWalletByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllUserWalletByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllUserWalletByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 balance = 3;
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package userwalletchangelog;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.UserWalletChangeLog";
|
||||
|
||||
service UserWalletChangeLogContract
|
||||
{
|
||||
rpc CreateNewUserWalletChangeLog(CreateNewUserWalletChangeLogRequest) returns (CreateNewUserWalletChangeLogResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewUserWalletChangeLog"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateUserWalletChangeLog(UpdateUserWalletChangeLogRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateUserWalletChangeLog"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteUserWalletChangeLog(DeleteUserWalletChangeLogRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteUserWalletChangeLog"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetUserWalletChangeLog(GetUserWalletChangeLogRequest) returns (GetUserWalletChangeLogResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetUserWalletChangeLog"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllUserWalletChangeLogByFilter(GetAllUserWalletChangeLogByFilterRequest) returns (GetAllUserWalletChangeLogByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllUserWalletChangeLogByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserWalletChangeLogRequest
|
||||
{
|
||||
int64 wallet_id = 1;
|
||||
int64 current_balance = 2;
|
||||
int64 change_value = 3;
|
||||
bool is_increase = 4;
|
||||
google.protobuf.Int64Value refrence_id = 5;
|
||||
}
|
||||
message CreateNewUserWalletChangeLogResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateUserWalletChangeLogRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 wallet_id = 2;
|
||||
int64 current_balance = 3;
|
||||
int64 change_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
}
|
||||
message DeleteUserWalletChangeLogRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserWalletChangeLogRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserWalletChangeLogResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 wallet_id = 2;
|
||||
int64 current_balance = 3;
|
||||
int64 change_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
}
|
||||
message GetAllUserWalletChangeLogByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllUserWalletChangeLogByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllUserWalletChangeLogByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value wallet_id = 2;
|
||||
google.protobuf.Int64Value current_balance = 3;
|
||||
google.protobuf.Int64Value change_value = 4;
|
||||
google.protobuf.BoolValue is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
}
|
||||
message GetAllUserWalletChangeLogByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllUserWalletChangeLogByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllUserWalletChangeLogByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 wallet_id = 2;
|
||||
int64 current_balance = 3;
|
||||
int64 change_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.FactorDetails;
|
||||
namespace CMSMicroservice.Protobuf.Validator.FactorDetails;
|
||||
|
||||
public class CreateNewFactorDetailsRequestValidator : AbstractValidator<CreateNewFactorDetailsRequest>
|
||||
{
|
||||
public CreateNewFactorDetailsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.ProductId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Count)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UnitPrice)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UnitDiscount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.OrderId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UnitDiscountPrice)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsChangePrice)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewFactorDetailsRequest>.CreateWithOptions((CreateNewFactorDetailsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.FactorDetails;
|
||||
namespace CMSMicroservice.Protobuf.Validator.FactorDetails;
|
||||
|
||||
public class DeleteFactorDetailsRequestValidator : AbstractValidator<DeleteFactorDetailsRequest>
|
||||
{
|
||||
public DeleteFactorDetailsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteFactorDetailsRequest>.CreateWithOptions((DeleteFactorDetailsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.FactorDetails;
|
||||
namespace CMSMicroservice.Protobuf.Validator.FactorDetails;
|
||||
|
||||
public class GetAllFactorDetailsByFilterRequestValidator : AbstractValidator<GetAllFactorDetailsByFilterRequest>
|
||||
{
|
||||
public GetAllFactorDetailsByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllFactorDetailsByFilterRequest>.CreateWithOptions((GetAllFactorDetailsByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.FactorDetails;
|
||||
namespace CMSMicroservice.Protobuf.Validator.FactorDetails;
|
||||
|
||||
public class GetFactorDetailsRequestValidator : AbstractValidator<GetFactorDetailsRequest>
|
||||
{
|
||||
public GetFactorDetailsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetFactorDetailsRequest>.CreateWithOptions((GetFactorDetailsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.FactorDetails;
|
||||
namespace CMSMicroservice.Protobuf.Validator.FactorDetails;
|
||||
|
||||
public class UpdateFactorDetailsRequestValidator : AbstractValidator<UpdateFactorDetailsRequest>
|
||||
{
|
||||
public UpdateFactorDetailsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ProductId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Count)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UnitPrice)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UnitDiscount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.OrderId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UnitDiscountPrice)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsChangePrice)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateFactorDetailsRequest>.CreateWithOptions((UpdateFactorDetailsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductGallerys;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductGallerys;
|
||||
|
||||
public class CreateNewProductGallerysRequestValidator : AbstractValidator<CreateNewProductGallerysRequest>
|
||||
{
|
||||
public CreateNewProductGallerysRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.ProductImageId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ProductId)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewProductGallerysRequest>.CreateWithOptions((CreateNewProductGallerysRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductGallerys;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductGallerys;
|
||||
|
||||
public class DeleteProductGallerysRequestValidator : AbstractValidator<DeleteProductGallerysRequest>
|
||||
{
|
||||
public DeleteProductGallerysRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteProductGallerysRequest>.CreateWithOptions((DeleteProductGallerysRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductGallerys;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductGallerys;
|
||||
|
||||
public class GetAllProductGallerysByFilterRequestValidator : AbstractValidator<GetAllProductGallerysByFilterRequest>
|
||||
{
|
||||
public GetAllProductGallerysByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllProductGallerysByFilterRequest>.CreateWithOptions((GetAllProductGallerysByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductGallerys;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductGallerys;
|
||||
|
||||
public class GetProductGallerysRequestValidator : AbstractValidator<GetProductGallerysRequest>
|
||||
{
|
||||
public GetProductGallerysRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetProductGallerysRequest>.CreateWithOptions((GetProductGallerysRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductGallerys;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductGallerys;
|
||||
|
||||
public class UpdateProductGallerysRequestValidator : AbstractValidator<UpdateProductGallerysRequest>
|
||||
{
|
||||
public UpdateProductGallerysRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ProductImageId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ProductId)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateProductGallerysRequest>.CreateWithOptions((UpdateProductGallerysRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductImages;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductImages;
|
||||
|
||||
public class CreateNewProductImagesRequestValidator : AbstractValidator<CreateNewProductImagesRequest>
|
||||
{
|
||||
public CreateNewProductImagesRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Title)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ImagePath)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ImageThumbnailPath)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewProductImagesRequest>.CreateWithOptions((CreateNewProductImagesRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductImages;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductImages;
|
||||
|
||||
public class DeleteProductImagesRequestValidator : AbstractValidator<DeleteProductImagesRequest>
|
||||
{
|
||||
public DeleteProductImagesRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteProductImagesRequest>.CreateWithOptions((DeleteProductImagesRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductImages;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductImages;
|
||||
|
||||
public class GetAllProductImagesByFilterRequestValidator : AbstractValidator<GetAllProductImagesByFilterRequest>
|
||||
{
|
||||
public GetAllProductImagesByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllProductImagesByFilterRequest>.CreateWithOptions((GetAllProductImagesByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductImages;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductImages;
|
||||
|
||||
public class GetProductImagesRequestValidator : AbstractValidator<GetProductImagesRequest>
|
||||
{
|
||||
public GetProductImagesRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetProductImagesRequest>.CreateWithOptions((GetProductImagesRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductImages;
|
||||
namespace CMSMicroservice.Protobuf.Validator.ProductImages;
|
||||
|
||||
public class UpdateProductImagesRequestValidator : AbstractValidator<UpdateProductImagesRequest>
|
||||
{
|
||||
public UpdateProductImagesRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Title)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ImagePath)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ImageThumbnailPath)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateProductImagesRequest>.CreateWithOptions((UpdateProductImagesRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Products;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Products;
|
||||
|
||||
public class CreateNewProductsRequestValidator : AbstractValidator<CreateNewProductsRequest>
|
||||
{
|
||||
public CreateNewProductsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Title)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Description)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ShortInfomation)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.FullInformation)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Price)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Discount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Rate)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ImagePath)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ThumbnailPath)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.SaleCount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ViewCount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.RemainingCount)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewProductsRequest>.CreateWithOptions((CreateNewProductsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Products;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Products;
|
||||
|
||||
public class DeleteProductsRequestValidator : AbstractValidator<DeleteProductsRequest>
|
||||
{
|
||||
public DeleteProductsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteProductsRequest>.CreateWithOptions((DeleteProductsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Products;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Products;
|
||||
|
||||
public class GetAllProductsByFilterRequestValidator : AbstractValidator<GetAllProductsByFilterRequest>
|
||||
{
|
||||
public GetAllProductsByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllProductsByFilterRequest>.CreateWithOptions((GetAllProductsByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Products;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Products;
|
||||
|
||||
public class GetProductsRequestValidator : AbstractValidator<GetProductsRequest>
|
||||
{
|
||||
public GetProductsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetProductsRequest>.CreateWithOptions((GetProductsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Products;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Products;
|
||||
|
||||
public class UpdateProductsRequestValidator : AbstractValidator<UpdateProductsRequest>
|
||||
{
|
||||
public UpdateProductsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Title)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Description)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ShortInfomation)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.FullInformation)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Price)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Discount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Rate)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ImagePath)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ThumbnailPath)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.SaleCount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ViewCount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.RemainingCount)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateProductsRequest>.CreateWithOptions((UpdateProductsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Transactions;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Transactions;
|
||||
|
||||
public class CreateNewTransactionsRequestValidator : AbstractValidator<CreateNewTransactionsRequest>
|
||||
{
|
||||
public CreateNewTransactionsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.MerchantId)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Amount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CallbackUrl)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Description)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.PaymentStatus)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
RuleFor(model => model.Type)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewTransactionsRequest>.CreateWithOptions((CreateNewTransactionsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Transactions;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Transactions;
|
||||
|
||||
public class DeleteTransactionsRequestValidator : AbstractValidator<DeleteTransactionsRequest>
|
||||
{
|
||||
public DeleteTransactionsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteTransactionsRequest>.CreateWithOptions((DeleteTransactionsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Transactions;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Transactions;
|
||||
|
||||
public class GetAllTransactionsByFilterRequestValidator : AbstractValidator<GetAllTransactionsByFilterRequest>
|
||||
{
|
||||
public GetAllTransactionsByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllTransactionsByFilterRequest>.CreateWithOptions((GetAllTransactionsByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Transactions;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Transactions;
|
||||
|
||||
public class GetTransactionsRequestValidator : AbstractValidator<GetTransactionsRequest>
|
||||
{
|
||||
public GetTransactionsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetTransactionsRequest>.CreateWithOptions((GetTransactionsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Transactions;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Transactions;
|
||||
|
||||
public class UpdateTransactionsRequestValidator : AbstractValidator<UpdateTransactionsRequest>
|
||||
{
|
||||
public UpdateTransactionsRequestValidator()
|
||||
{
|
||||
RuleFor(model => 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)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
RuleFor(model => model.Type)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateTransactionsRequest>.CreateWithOptions((UpdateTransactionsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserCarts;
|
||||
|
||||
public class CreateNewUserCartsRequestValidator : AbstractValidator<CreateNewUserCartsRequest>
|
||||
{
|
||||
public CreateNewUserCartsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.ProductId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Count)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewUserCartsRequest>.CreateWithOptions((CreateNewUserCartsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserCarts;
|
||||
|
||||
public class DeleteUserCartsRequestValidator : AbstractValidator<DeleteUserCartsRequest>
|
||||
{
|
||||
public DeleteUserCartsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteUserCartsRequest>.CreateWithOptions((DeleteUserCartsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserCarts;
|
||||
|
||||
public class GetAllUserCartsByFilterRequestValidator : AbstractValidator<GetAllUserCartsByFilterRequest>
|
||||
{
|
||||
public GetAllUserCartsByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllUserCartsByFilterRequest>.CreateWithOptions((GetAllUserCartsByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserCarts;
|
||||
|
||||
public class GetUserCartsRequestValidator : AbstractValidator<GetUserCartsRequest>
|
||||
{
|
||||
public GetUserCartsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetUserCartsRequest>.CreateWithOptions((GetUserCartsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserCarts;
|
||||
|
||||
public class UpdateUserCartsRequestValidator : AbstractValidator<UpdateUserCartsRequest>
|
||||
{
|
||||
public UpdateUserCartsRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ProductId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Count)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateUserCartsRequest>.CreateWithOptions((UpdateUserCartsRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWallet;
|
||||
|
||||
public class CreateNewUserWalletRequestValidator : AbstractValidator<CreateNewUserWalletRequest>
|
||||
{
|
||||
public CreateNewUserWalletRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Balance)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewUserWalletRequest>.CreateWithOptions((CreateNewUserWalletRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWallet;
|
||||
|
||||
public class DeleteUserWalletRequestValidator : AbstractValidator<DeleteUserWalletRequest>
|
||||
{
|
||||
public DeleteUserWalletRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteUserWalletRequest>.CreateWithOptions((DeleteUserWalletRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWallet;
|
||||
|
||||
public class GetAllUserWalletByFilterRequestValidator : AbstractValidator<GetAllUserWalletByFilterRequest>
|
||||
{
|
||||
public GetAllUserWalletByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllUserWalletByFilterRequest>.CreateWithOptions((GetAllUserWalletByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWallet;
|
||||
|
||||
public class GetUserWalletRequestValidator : AbstractValidator<GetUserWalletRequest>
|
||||
{
|
||||
public GetUserWalletRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetUserWalletRequest>.CreateWithOptions((GetUserWalletRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWallet;
|
||||
|
||||
public class UpdateUserWalletRequestValidator : AbstractValidator<UpdateUserWalletRequest>
|
||||
{
|
||||
public UpdateUserWalletRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Balance)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateUserWalletRequest>.CreateWithOptions((UpdateUserWalletRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWalletChangeLog;
|
||||
|
||||
public class CreateNewUserWalletChangeLogRequestValidator : AbstractValidator<CreateNewUserWalletChangeLogRequest>
|
||||
{
|
||||
public CreateNewUserWalletChangeLogRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.WalletId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CurrentBalance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsIncrease)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewUserWalletChangeLogRequest>.CreateWithOptions((CreateNewUserWalletChangeLogRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWalletChangeLog;
|
||||
|
||||
public class DeleteUserWalletChangeLogRequestValidator : AbstractValidator<DeleteUserWalletChangeLogRequest>
|
||||
{
|
||||
public DeleteUserWalletChangeLogRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteUserWalletChangeLogRequest>.CreateWithOptions((DeleteUserWalletChangeLogRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWalletChangeLog;
|
||||
|
||||
public class GetAllUserWalletChangeLogByFilterRequestValidator : AbstractValidator<GetAllUserWalletChangeLogByFilterRequest>
|
||||
{
|
||||
public GetAllUserWalletChangeLogByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllUserWalletChangeLogByFilterRequest>.CreateWithOptions((GetAllUserWalletChangeLogByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWalletChangeLog;
|
||||
|
||||
public class GetUserWalletChangeLogRequestValidator : AbstractValidator<GetUserWalletChangeLogRequest>
|
||||
{
|
||||
public GetUserWalletChangeLogRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetUserWalletChangeLogRequest>.CreateWithOptions((GetUserWalletChangeLogRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserWalletChangeLog;
|
||||
|
||||
public class UpdateUserWalletChangeLogRequestValidator : AbstractValidator<UpdateUserWalletChangeLogRequest>
|
||||
{
|
||||
public UpdateUserWalletChangeLogRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.WalletId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CurrentBalance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsIncrease)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateUserWalletChangeLogRequest>.CreateWithOptions((UpdateUserWalletChangeLogRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user