Generator Changes at 9/27/2025 10:36:00 AM

This commit is contained in:
generator
2025-09-27 10:36:00 +03:30
parent 15a7933a7a
commit 0e32dc9359
220 changed files with 7313 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
public record CreateNewUserCommand : IRequest<CreateNewUserResponseDto>
{
//نام
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; }
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
public class CreateNewUserCommandHandler : IRequestHandler<CreateNewUserCommand, CreateNewUserResponseDto>
{
private readonly IApplicationContractContext _context;
public CreateNewUserCommandHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<CreateNewUserResponseDto> Handle(CreateNewUserCommand request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new CreateNewUserResponseDto();
}
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
public class CreateNewUserCommandValidator : AbstractValidator<CreateNewUserCommand>
{
public CreateNewUserCommandValidator()
{
RuleFor(model => model.Mobile)
.NotEmpty();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<CreateNewUserCommand>.CreateWithOptions((CreateNewUserCommand)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,7 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
public class CreateNewUserResponseDto
{
//شناسه
public long Id { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.DeleteUser;
public record DeleteUserCommand : IRequest<Unit>
{
//شناسه
public long Id { get; init; }
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.DeleteUser;
public class DeleteUserCommandHandler : IRequestHandler<DeleteUserCommand, Unit>
{
private readonly IApplicationContractContext _context;
public DeleteUserCommandHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<Unit> Handle(DeleteUserCommand request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new Unit();
}
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.DeleteUser;
public class DeleteUserCommandValidator : AbstractValidator<DeleteUserCommand>
{
public DeleteUserCommandValidator()
{
RuleFor(model => model.Id)
.NotNull();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<DeleteUserCommand>.CreateWithOptions((DeleteUserCommand)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,19 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.UpdateUser;
public record UpdateUserCommand : IRequest<Unit>
{
//شناسه
public long Id { get; init; }
//نام
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; }
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.UpdateUser;
public class UpdateUserCommandHandler : IRequestHandler<UpdateUserCommand, Unit>
{
private readonly IApplicationContractContext _context;
public UpdateUserCommandHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<Unit> Handle(UpdateUserCommand request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new Unit();
}
}

View File

@@ -0,0 +1,18 @@
namespace FrontOffice.BFF.Application.UserCQ.Commands.UpdateUser;
public class UpdateUserCommandValidator : AbstractValidator<UpdateUserCommand>
{
public UpdateUserCommandValidator()
{
RuleFor(model => model.Id)
.NotNull();
RuleFor(model => model.Mobile)
.NotEmpty();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<UpdateUserCommand>.CreateWithOptions((UpdateUserCommand)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,27 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
public record GetAllUserByFilterQuery : IRequest<GetAllUserByFilterResponseDto>
{
//موقعیت صفحه بندی
public PaginationState? PaginationState { get; init; }
//مرتب سازی بر اساس
public string? SortBy { get; init; }
//فیلتر
public GetAllUserByFilterFilter? Filter { get; init; }
}public class GetAllUserByFilterFilter
{
//شناسه
public long? Id { get; set; }
//نام
public string? FirstName { get; set; }
//نام خانوادگی
public string? LastName { get; set; }
//شماره موبایل
public string? Mobile { get; set; }
//کد ملی
public string? NationalCode { get; set; }
//آدرس آواتار
public string? AvatarPath { get; set; }
//شناسه والد
public long? ParentId { get; set; }
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilterQuery, GetAllUserByFilterResponseDto>
{
private readonly IApplicationContractContext _context;
public GetAllUserByFilterQueryHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<GetAllUserByFilterResponseDto> Handle(GetAllUserByFilterQuery request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new GetAllUserByFilterResponseDto();
}
}

View File

@@ -0,0 +1,14 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
public class GetAllUserByFilterQueryValidator : AbstractValidator<GetAllUserByFilterQuery>
{
public GetAllUserByFilterQueryValidator()
{
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<GetAllUserByFilterQuery>.CreateWithOptions((GetAllUserByFilterQuery)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,25 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
public class GetAllUserByFilterResponseDto
{
//متادیتا
public MetaData MetaData { get; set; }
//مدل خروجی
public List<GetAllUserByFilterResponseModel>? Models { get; set; }
}public class GetAllUserByFilterResponseModel
{
//شناسه
public long Id { get; set; }
//نام
public string? FirstName { get; set; }
//نام خانوادگی
public string? LastName { get; set; }
//شماره موبایل
public string Mobile { get; set; }
//کد ملی
public string? NationalCode { get; set; }
//آدرس آواتار
public string? AvatarPath { get; set; }
//شناسه والد
public long? ParentId { get; set; }
}

View File

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

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponseDto>
{
private readonly IApplicationContractContext _context;
public GetUserQueryHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<GetUserResponseDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new GetUserResponseDto();
}
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
public class GetUserQueryValidator : AbstractValidator<GetUserQuery>
{
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)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,19 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
public class GetUserResponseDto
{
//شناسه
public long Id { get; set; }
//نام
public string? FirstName { get; set; }
//نام خانوادگی
public string? LastName { get; set; }
//شماره موبایل
public string Mobile { get; set; }
//کد ملی
public string? NationalCode { get; set; }
//آدرس آواتار
public string? AvatarPath { get; set; }
//شناسه والد
public long? ParentId { get; set; }
}