Generator Changes at 11/14/2025 3:36:13 PM +03:30
This commit is contained in:
@@ -60,6 +60,18 @@ service UserContract
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc CreateContractOtpToken(CreateContractOtpTokenRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateContractOtpToken"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc AcceptContract(AcceptContractRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
post: "/AcceptContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message UpdateUserRequest
|
||||
{
|
||||
@@ -188,6 +200,15 @@ message SetPasswordForUserRequest
|
||||
string new_password = 2;
|
||||
string confirm_password = 3;
|
||||
}
|
||||
message CreateContractOtpTokenRequest
|
||||
{
|
||||
google.protobuf.StringValue cotract_guid = 1;
|
||||
}
|
||||
message AcceptContractRequest
|
||||
{
|
||||
google.protobuf.StringValue code = 1;
|
||||
google.protobuf.StringValue contract_html = 2;
|
||||
}
|
||||
|
||||
message PaginationState
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using FrontOfficeMicroservice.Protobuf.Protos.User;
|
||||
namespace FrontOfficeMicroservice.Protobuf.Validator.User;
|
||||
|
||||
public class AcceptContractRequestValidator : AbstractValidator<AcceptContractRequest>
|
||||
{
|
||||
public AcceptContractRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<AcceptContractRequest>.CreateWithOptions((AcceptContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using FrontOfficeMicroservice.Protobuf.Protos.User;
|
||||
namespace FrontOfficeMicroservice.Protobuf.Validator.User;
|
||||
|
||||
public class CreateContractOtpTokenRequestValidator : AbstractValidator<CreateContractOtpTokenRequest>
|
||||
{
|
||||
public CreateContractOtpTokenRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateContractOtpTokenRequest>.CreateWithOptions((CreateContractOtpTokenRequest)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