Generator Changes at 10/13/2025 8:08:52 AM
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.116</Version>
|
||||
<Version>0.0.117</Version>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
|
||||
@@ -58,6 +58,10 @@ message CreateNewUserRequest
|
||||
google.protobuf.StringValue national_code = 4;
|
||||
google.protobuf.StringValue avatar_path = 5;
|
||||
google.protobuf.Int64Value parent_id = 6;
|
||||
bool email_notifications = 7;
|
||||
bool sms_notifications = 8;
|
||||
bool push_notifications = 9;
|
||||
google.protobuf.Timestamp birth_date = 10;
|
||||
}
|
||||
message CreateNewUserResponse
|
||||
{
|
||||
@@ -72,6 +76,10 @@ message UpdateUserRequest
|
||||
google.protobuf.StringValue avatar_path = 5;
|
||||
bool is_rules_accepted = 6;
|
||||
google.protobuf.Timestamp rules_accepted_at = 7;
|
||||
bool email_notifications = 8;
|
||||
bool sms_notifications = 9;
|
||||
bool push_notifications = 10;
|
||||
google.protobuf.Timestamp birth_date = 11;
|
||||
}
|
||||
message DeleteUserRequest
|
||||
{
|
||||
@@ -93,6 +101,10 @@ message GetUserResponse
|
||||
string referral_code = 8;
|
||||
bool is_mobile_verified = 9;
|
||||
google.protobuf.Timestamp mobile_verified_at = 10;
|
||||
bool email_notifications = 11;
|
||||
bool sms_notifications = 12;
|
||||
bool push_notifications = 13;
|
||||
google.protobuf.Timestamp birth_date = 14;
|
||||
}
|
||||
message GetAllUserByFilterRequest
|
||||
{
|
||||
@@ -112,6 +124,10 @@ message GetAllUserByFilterFilter
|
||||
google.protobuf.StringValue referral_code = 8;
|
||||
google.protobuf.BoolValue is_mobile_verified = 9;
|
||||
google.protobuf.Timestamp mobile_verified_at = 10;
|
||||
google.protobuf.BoolValue email_notifications = 11;
|
||||
google.protobuf.BoolValue sms_notifications = 12;
|
||||
google.protobuf.BoolValue push_notifications = 13;
|
||||
google.protobuf.Timestamp birth_date = 14;
|
||||
}
|
||||
message GetAllUserByFilterResponse
|
||||
{
|
||||
@@ -130,6 +146,10 @@ message GetAllUserByFilterResponseModel
|
||||
string referral_code = 8;
|
||||
bool is_mobile_verified = 9;
|
||||
google.protobuf.Timestamp mobile_verified_at = 10;
|
||||
bool email_notifications = 11;
|
||||
bool sms_notifications = 12;
|
||||
bool push_notifications = 13;
|
||||
google.protobuf.Timestamp birth_date = 14;
|
||||
}
|
||||
message GetJwtTokenRequest
|
||||
{
|
||||
|
||||
@@ -43,6 +43,12 @@ service UserAddressContract
|
||||
|
||||
};
|
||||
};
|
||||
rpc SetAddressAsDefault(SetAddressAsDefaultRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
post: "/SetAddressAsDefault"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserAddressRequest
|
||||
{
|
||||
@@ -116,3 +122,7 @@ message GetAllUserAddressByFilterResponseModel
|
||||
bool is_default = 6;
|
||||
int64 city_id = 7;
|
||||
}
|
||||
message SetAddressAsDefaultRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ message CreateNewUserOrderRequest
|
||||
bool payment_status = 4;
|
||||
google.protobuf.Timestamp payment_date = 5;
|
||||
int64 user_id = 6;
|
||||
int64 user_address_id = 7;
|
||||
}
|
||||
message CreateNewUserOrderResponse
|
||||
{
|
||||
@@ -66,6 +67,7 @@ message UpdateUserOrderRequest
|
||||
bool payment_status = 5;
|
||||
google.protobuf.Timestamp payment_date = 6;
|
||||
int64 user_id = 7;
|
||||
int64 user_address_id = 8;
|
||||
}
|
||||
message DeleteUserOrderRequest
|
||||
{
|
||||
@@ -84,6 +86,7 @@ message GetUserOrderResponse
|
||||
bool payment_status = 5;
|
||||
google.protobuf.Timestamp payment_date = 6;
|
||||
int64 user_id = 7;
|
||||
int64 user_address_id = 8;
|
||||
}
|
||||
message GetAllUserOrderByFilterRequest
|
||||
{
|
||||
@@ -100,6 +103,7 @@ message GetAllUserOrderByFilterFilter
|
||||
google.protobuf.BoolValue payment_status = 5;
|
||||
google.protobuf.Timestamp payment_date = 6;
|
||||
google.protobuf.Int64Value user_id = 7;
|
||||
google.protobuf.Int64Value user_address_id = 8;
|
||||
}
|
||||
message GetAllUserOrderByFilterResponse
|
||||
{
|
||||
@@ -115,4 +119,5 @@ message GetAllUserOrderByFilterResponseModel
|
||||
bool payment_status = 5;
|
||||
google.protobuf.Timestamp payment_date = 6;
|
||||
int64 user_id = 7;
|
||||
int64 user_address_id = 8;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,12 @@ public class CreateNewUserRequestValidator : AbstractValidator<CreateNewUserRequ
|
||||
{
|
||||
RuleFor(model => model.Mobile)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.EmailNotifications)
|
||||
.NotNull();
|
||||
RuleFor(model => model.SmsNotifications)
|
||||
.NotNull();
|
||||
RuleFor(model => model.PushNotifications)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -10,6 +10,12 @@ public class UpdateUserRequestValidator : AbstractValidator<UpdateUserRequest>
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsRulesAccepted)
|
||||
.NotNull();
|
||||
RuleFor(model => model.EmailNotifications)
|
||||
.NotNull();
|
||||
RuleFor(model => model.SmsNotifications)
|
||||
.NotNull();
|
||||
RuleFor(model => model.PushNotifications)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserAddress;
|
||||
|
||||
public class SetAddressAsDefaultRequestValidator : AbstractValidator<SetAddressAsDefaultRequest>
|
||||
{
|
||||
public SetAddressAsDefaultRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<SetAddressAsDefaultRequest>.CreateWithOptions((SetAddressAsDefaultRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -14,6 +14,8 @@ public class CreateNewUserOrderRequestValidator : AbstractValidator<CreateNewUse
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserAddressId)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -16,6 +16,8 @@ public class UpdateUserOrderRequestValidator : AbstractValidator<UpdateUserOrder
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserAddressId)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user