Generator Changes at 9/28/2025 6:32:18 AM

This commit is contained in:
MeysamMoghaddam
2025-09-28 06:51:49 +03:30
parent 7f3e541633
commit dc0ba7a5ef
11 changed files with 26 additions and 15 deletions

View File

@@ -8519,7 +8519,7 @@
"name": "ParentReferralCode",
"type": "nvarchar",
"size": -2147483648,
"isNullable": "No",
"isNullable": "Yes",
"scale": -2147483648,
"comment": "کد معرف والد",
"computedExpression": "",

View File

@@ -5,5 +5,9 @@ public class CreateNewOtpTokenResponseDto
public bool Success { get; set; }
//پیام
public string Message { get; set; }
//تلاش باقی مانده
public int RemainingAttempts { get; set; }
//ثانیه باقی مانده
public int RemainingSeconds { get; set; }
}

View File

@@ -7,5 +7,7 @@ public record VerifyOtpTokenCommand : IRequest<VerifyOtpTokenResponseDto>
public string Purpose { get; init; }
//کد
public string Code { get; init; }
//کد معرف والد
public string ParentReferralCode { get; init; }
}

View File

@@ -1,4 +1,4 @@
using CMSMicroservice.Protobuf.Protos.OtpToken;
using CMSMicroservice.Protobuf.Protos.OtpToken;
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto>

View File

@@ -9,6 +9,8 @@ public class VerifyOtpTokenCommandValidator : AbstractValidator<VerifyOtpTokenCo
.NotEmpty();
RuleFor(model => model.Code)
.NotEmpty();
RuleFor(model => model.ParentReferralCode)
.NotEmpty();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{

View File

@@ -7,5 +7,9 @@ public class VerifyOtpTokenResponseDto
public string Message { get; set; }
//توکن
public string? Token { get; set; }
//تلاش باقی مانده
public int RemainingAttempts { get; set; }
//ثانیه باقی مانده
public int RemainingSeconds { get; set; }
}

View File

@@ -1,7 +1,5 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
public record GetUserQuery : IRequest<GetUserResponseDto>
{
//شناسه
public long Id { get; init; }
}

View File

@@ -1,14 +1,12 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
public class GetUserQueryValidator : AbstractValidator<GetUserQuery>
public class GetUserQueryValidator : AbstractValidator<Unit>
{
public GetUserQueryValidator()
{
RuleFor(model => model.Id)
.NotNull();
}
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)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);

View File

@@ -23,9 +23,9 @@ public class UserService : UserContract.UserContractBase
{
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)
{

View File

@@ -24,7 +24,7 @@ service UserContract
body: "*"
};
};
rpc GetUser(GetUserRequest) returns (GetUserResponse){
rpc GetUser(google.protobuf.Empty) returns (GetUserResponse){
option (google.api.http) = {
get: "/GetUser"
@@ -68,10 +68,6 @@ message DeleteUserRequest
{
int64 id = 1;
}
message GetUserRequest
{
int64 id = 1;
}
message GetUserResponse
{
int64 id = 1;
@@ -131,18 +127,23 @@ message CreateNewOtpTokenResponse
{
bool success = 1;
string message = 2;
int32 remaining_attempts = 3;
int32 remaining_seconds = 4;
}
message VerifyOtpTokenRequest
{
string mobile = 1;
string purpose = 2;
string code = 3;
string parent_referral_code = 4;
}
message VerifyOtpTokenResponse
{
bool success = 1;
string message = 2;
google.protobuf.StringValue token = 3;
int32 remaining_attempts = 4;
int32 remaining_seconds = 5;
}
message PaginationState

View File

@@ -12,6 +12,8 @@ public class VerifyOtpTokenRequestValidator : AbstractValidator<VerifyOtpTokenRe
.NotEmpty();
RuleFor(model => model.Code)
.NotEmpty();
RuleFor(model => model.ParentReferralCode)
.NotEmpty();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{