Generator Changes at 9/28/2025 12:17:26 AM
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewOtpToken;
|
||||
public record CreateNewOtpTokenCommand : IRequest<CreateNewOtpTokenResponseDto>
|
||||
{
|
||||
//موبایل مقصد
|
||||
public string Mobile { get; init; }
|
||||
//مقصود
|
||||
public string Purpose { get; init; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewOtpToken;
|
||||
public class CreateNewOtpTokenCommandHandler : IRequestHandler<CreateNewOtpTokenCommand, CreateNewOtpTokenResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
|
||||
public CreateNewOtpTokenCommandHandler(IApplicationContractContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<CreateNewOtpTokenResponseDto> Handle(CreateNewOtpTokenCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewOtpTokenResponseDto();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewOtpToken;
|
||||
public class CreateNewOtpTokenCommandValidator : AbstractValidator<CreateNewOtpTokenCommand>
|
||||
{
|
||||
public CreateNewOtpTokenCommandValidator()
|
||||
{
|
||||
RuleFor(model => model.Mobile)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Purpose)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewOtpTokenCommand>.CreateWithOptions((CreateNewOtpTokenCommand)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewOtpToken;
|
||||
public class CreateNewOtpTokenResponseDto
|
||||
{
|
||||
//موفق؟
|
||||
public bool Success { get; set; }
|
||||
//پیام
|
||||
public string Message { get; set; }
|
||||
//کد
|
||||
public string? Code { get; set; }
|
||||
|
||||
}
|
||||
@@ -7,13 +7,19 @@ public record UpdateUserCommand : IRequest<Unit>
|
||||
public string? FirstName { get; init; }
|
||||
//نام خانوادگی
|
||||
public string? LastName { get; init; }
|
||||
//شماره موبایل
|
||||
public string Mobile { get; init; }
|
||||
//کد ملی
|
||||
public string? NationalCode { get; init; }
|
||||
//آدرس آواتار
|
||||
public string? AvatarPath { get; init; }
|
||||
//شناسه والد
|
||||
public long? ParentId { get; init; }
|
||||
//فایل آواتار
|
||||
public UserAvatarFileModel? AvatarFile { get; init; }
|
||||
|
||||
}
|
||||
}public class UserAvatarFileModel
|
||||
{
|
||||
//اسم فایل
|
||||
public string? FileName { get; set; }
|
||||
//نوع فایل
|
||||
public string? FileMime { get; set; }
|
||||
//فایل
|
||||
public byte[]? File { get; set; }
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ public class UpdateUserCommandValidator : AbstractValidator<UpdateUserCommand>
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Mobile)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
||||
public record VerifyOtpTokenCommand : IRequest<VerifyOtpTokenResponseDto>
|
||||
{
|
||||
//موبایل مقصد
|
||||
public string Mobile { get; init; }
|
||||
//مقصود
|
||||
public string Purpose { get; init; }
|
||||
//کد
|
||||
public string Code { get; init; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
||||
public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
|
||||
public VerifyOtpTokenCommandHandler(IApplicationContractContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<VerifyOtpTokenResponseDto> Handle(VerifyOtpTokenCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new VerifyOtpTokenResponseDto();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
||||
public class VerifyOtpTokenCommandValidator : AbstractValidator<VerifyOtpTokenCommand>
|
||||
{
|
||||
public VerifyOtpTokenCommandValidator()
|
||||
{
|
||||
RuleFor(model => model.Mobile)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Purpose)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Code)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<VerifyOtpTokenCommand>.CreateWithOptions((VerifyOtpTokenCommand)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
||||
public class VerifyOtpTokenResponseDto
|
||||
{
|
||||
//موفق؟
|
||||
public bool Success { get; set; }
|
||||
//پیام
|
||||
public string Message { get; set; }
|
||||
//شناسه کاربر
|
||||
public long? UserId { get; set; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user