Generator Changes at 9/28/2025 6:32:18 AM
This commit is contained in:
@@ -8519,7 +8519,7 @@
|
|||||||
"name": "ParentReferralCode",
|
"name": "ParentReferralCode",
|
||||||
"type": "nvarchar",
|
"type": "nvarchar",
|
||||||
"size": -2147483648,
|
"size": -2147483648,
|
||||||
"isNullable": "No",
|
"isNullable": "Yes",
|
||||||
"scale": -2147483648,
|
"scale": -2147483648,
|
||||||
"comment": "کد معرف والد",
|
"comment": "کد معرف والد",
|
||||||
"computedExpression": "",
|
"computedExpression": "",
|
||||||
|
|||||||
@@ -5,5 +5,9 @@ public class CreateNewOtpTokenResponseDto
|
|||||||
public bool Success { get; set; }
|
public bool Success { get; set; }
|
||||||
//پیام
|
//پیام
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
|
//تلاش باقی مانده
|
||||||
|
public int RemainingAttempts { get; set; }
|
||||||
|
//ثانیه باقی مانده
|
||||||
|
public int RemainingSeconds { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,5 +7,7 @@ public record VerifyOtpTokenCommand : IRequest<VerifyOtpTokenResponseDto>
|
|||||||
public string Purpose { get; init; }
|
public string Purpose { get; init; }
|
||||||
//کد
|
//کد
|
||||||
public string Code { get; init; }
|
public string Code { get; init; }
|
||||||
|
//کد معرف والد
|
||||||
|
public string ParentReferralCode { get; init; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using CMSMicroservice.Protobuf.Protos.OtpToken;
|
using CMSMicroservice.Protobuf.Protos.OtpToken;
|
||||||
|
|
||||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
||||||
public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto>
|
public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ public class VerifyOtpTokenCommandValidator : AbstractValidator<VerifyOtpTokenCo
|
|||||||
.NotEmpty();
|
.NotEmpty();
|
||||||
RuleFor(model => model.Code)
|
RuleFor(model => model.Code)
|
||||||
.NotEmpty();
|
.NotEmpty();
|
||||||
|
RuleFor(model => model.ParentReferralCode)
|
||||||
|
.NotEmpty();
|
||||||
}
|
}
|
||||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,5 +7,9 @@ public class VerifyOtpTokenResponseDto
|
|||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
//توکن
|
//توکن
|
||||||
public string? Token { get; set; }
|
public string? Token { get; set; }
|
||||||
|
//تلاش باقی مانده
|
||||||
|
public int RemainingAttempts { get; set; }
|
||||||
|
//ثانیه باقی مانده
|
||||||
|
public int RemainingSeconds { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||||
public record GetUserQuery : IRequest<GetUserResponseDto>
|
public record GetUserQuery : IRequest<GetUserResponseDto>
|
||||||
{
|
{
|
||||||
//شناسه
|
|
||||||
public long Id { get; init; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||||
public class GetUserQueryValidator : AbstractValidator<GetUserQuery>
|
public class GetUserQueryValidator : AbstractValidator<Unit>
|
||||||
{
|
{
|
||||||
public GetUserQueryValidator()
|
public GetUserQueryValidator()
|
||||||
{
|
{
|
||||||
RuleFor(model => model.Id)
|
|
||||||
.NotNull();
|
|
||||||
}
|
}
|
||||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||||
{
|
{
|
||||||
var result = await ValidateAsync(ValidationContext<GetUserQuery>.CreateWithOptions((GetUserQuery)model, x => x.IncludeProperties(propertyName)));
|
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
|
||||||
if (result.IsValid)
|
if (result.IsValid)
|
||||||
return Array.Empty<string>();
|
return Array.Empty<string>();
|
||||||
return result.Errors.Select(e => e.ErrorMessage);
|
return result.Errors.Select(e => e.ErrorMessage);
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ public class UserService : UserContract.UserContractBase
|
|||||||
{
|
{
|
||||||
return await _dispatchRequestToCQRS.Handle<DeleteUserRequest, DeleteUserCommand>(request, context);
|
return await _dispatchRequestToCQRS.Handle<DeleteUserRequest, DeleteUserCommand>(request, context);
|
||||||
}
|
}
|
||||||
public override async Task<GetUserResponse> GetUser(GetUserRequest request, ServerCallContext context)
|
public override async Task<GetUserResponse> GetUser(Empty request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return await _dispatchRequestToCQRS.Handle<GetUserRequest, GetUserQuery, GetUserResponse>(request, context);
|
return await _dispatchRequestToCQRS.Handle<GetUserQuery, GetUserResponse>(context);
|
||||||
}
|
}
|
||||||
public override async Task<GetAllUserByFilterResponse> GetAllUserByFilter(GetAllUserByFilterRequest request, ServerCallContext context)
|
public override async Task<GetAllUserByFilterResponse> GetAllUserByFilter(GetAllUserByFilterRequest request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ service UserContract
|
|||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
rpc GetUser(GetUserRequest) returns (GetUserResponse){
|
rpc GetUser(google.protobuf.Empty) returns (GetUserResponse){
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/GetUser"
|
get: "/GetUser"
|
||||||
|
|
||||||
@@ -68,10 +68,6 @@ message DeleteUserRequest
|
|||||||
{
|
{
|
||||||
int64 id = 1;
|
int64 id = 1;
|
||||||
}
|
}
|
||||||
message GetUserRequest
|
|
||||||
{
|
|
||||||
int64 id = 1;
|
|
||||||
}
|
|
||||||
message GetUserResponse
|
message GetUserResponse
|
||||||
{
|
{
|
||||||
int64 id = 1;
|
int64 id = 1;
|
||||||
@@ -131,18 +127,23 @@ message CreateNewOtpTokenResponse
|
|||||||
{
|
{
|
||||||
bool success = 1;
|
bool success = 1;
|
||||||
string message = 2;
|
string message = 2;
|
||||||
|
int32 remaining_attempts = 3;
|
||||||
|
int32 remaining_seconds = 4;
|
||||||
}
|
}
|
||||||
message VerifyOtpTokenRequest
|
message VerifyOtpTokenRequest
|
||||||
{
|
{
|
||||||
string mobile = 1;
|
string mobile = 1;
|
||||||
string purpose = 2;
|
string purpose = 2;
|
||||||
string code = 3;
|
string code = 3;
|
||||||
|
string parent_referral_code = 4;
|
||||||
}
|
}
|
||||||
message VerifyOtpTokenResponse
|
message VerifyOtpTokenResponse
|
||||||
{
|
{
|
||||||
bool success = 1;
|
bool success = 1;
|
||||||
string message = 2;
|
string message = 2;
|
||||||
google.protobuf.StringValue token = 3;
|
google.protobuf.StringValue token = 3;
|
||||||
|
int32 remaining_attempts = 4;
|
||||||
|
int32 remaining_seconds = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PaginationState
|
message PaginationState
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public class VerifyOtpTokenRequestValidator : AbstractValidator<VerifyOtpTokenRe
|
|||||||
.NotEmpty();
|
.NotEmpty();
|
||||||
RuleFor(model => model.Code)
|
RuleFor(model => model.Code)
|
||||||
.NotEmpty();
|
.NotEmpty();
|
||||||
|
RuleFor(model => model.ParentReferralCode)
|
||||||
|
.NotEmpty();
|
||||||
}
|
}
|
||||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user