server cleanup
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@
|
||||
<None Remove="Common\ValidationBase\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CleanArc.Domain\CleanArc.Domain.csproj" />
|
||||
<ProjectReference Include="..\Baya.Domain\Baya.Domain.csproj" />
|
||||
<PackageReference Include="Mediator.SourceGenerator">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CleanArc.Application.Common;
|
||||
namespace Baya.Application.Common;
|
||||
|
||||
public class LoggingBehavior<TRequest, TResponse>(ILogger<LoggingBehavior<TRequest, TResponse>> logger)
|
||||
: IPipelineBehavior<TRequest, TResponse>
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.Diagnostics.Metrics;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Common;
|
||||
namespace Baya.Application.Common;
|
||||
|
||||
public class MetricsBehaviour<TRequest, TResponse> :
|
||||
IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Models.Common;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Common;
|
||||
namespace Baya.Application.Common;
|
||||
|
||||
public class ValidateCommandBehavior<TRequest, TResponse>(IEnumerable<IValidator<TRequest>> validators)
|
||||
: IPipelineBehavior<TRequest, TResponse>
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using System.Security.Claims;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Baya.Domain.Entities.User;
|
||||
|
||||
namespace CleanArc.Application.Contracts;
|
||||
namespace Baya.Application.Contracts;
|
||||
|
||||
public interface IJwtService
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Domain.Entities.User;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Application.Contracts.Identity;
|
||||
namespace Baya.Application.Contracts.Identity;
|
||||
|
||||
public interface IAppUserManager
|
||||
{
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Models.Identity;
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Application.Models.Identity;
|
||||
using Baya.Domain.Entities.User;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Application.Contracts.Identity;
|
||||
namespace Baya.Application.Contracts.Identity;
|
||||
|
||||
public interface IRoleManagerService
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Domain.Entities.Order;
|
||||
using Baya.Domain.Entities.Order;
|
||||
|
||||
namespace CleanArc.Application.Contracts.Persistence;
|
||||
namespace Baya.Application.Contracts.Persistence;
|
||||
|
||||
public interface IOrderRepository
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Contracts.Persistence;
|
||||
namespace Baya.Application.Contracts.Persistence;
|
||||
|
||||
public interface IUnitOfWork
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Domain.Entities.User;
|
||||
|
||||
namespace CleanArc.Application.Contracts.Persistence;
|
||||
namespace Baya.Application.Contracts.Persistence;
|
||||
|
||||
public interface IUserRefreshTokenRepository
|
||||
{
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using CleanArc.SharedKernel.Extensions;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Domain.Entities.User;
|
||||
using Baya.SharedKernel.Extensions;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Admin.Commands.AddAdminCommand
|
||||
namespace Baya.Application.Features.Admin.Commands.AddAdminCommand
|
||||
{
|
||||
internal class AddAdminCommandHandler:IRequestHandler<AddAdminCommand,OperationResult<bool>>
|
||||
{
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Admin.Commands.AddAdminCommand;
|
||||
namespace Baya.Application.Features.Admin.Commands.AddAdminCommand;
|
||||
|
||||
public record AddAdminCommand
|
||||
(string UserName, string Email, string Password, int RoleId) : IRequest<OperationResult<bool>>,
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
using CleanArc.Application.Contracts;
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using Baya.Application.Contracts;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Admin.Queries.GetToken;
|
||||
namespace Baya.Application.Features.Admin.Queries.GetToken;
|
||||
|
||||
public class AdminGetTokenQueryHandler:IRequestHandler<AdminGetTokenQuery,OperationResult<AdminGetTokenQueryResult>>
|
||||
{
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
using Baya.Application.Models.Jwt;
|
||||
|
||||
namespace Baya.Application.Features.Admin.Queries.GetToken;
|
||||
|
||||
public record AdminGetTokenQueryResult(AccessToken Token,string[] Roles);
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Admin.Queries.GetToken;
|
||||
namespace Baya.Application.Features.Admin.Queries.GetToken;
|
||||
|
||||
public record AdminGetTokenQuery(string UserName, string Password) : IRequest<OperationResult<AdminGetTokenQueryResult>>,
|
||||
IValidatableModel<AdminGetTokenQuery>
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Contracts.Persistence;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Contracts.Persistence;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Commands;
|
||||
namespace Baya.Application.Features.Order.Commands;
|
||||
|
||||
internal class AddOrderCommandHandler(IUnitOfWork unitOfWork, IAppUserManager userManager)
|
||||
: IRequestHandler<AddOrderCommand, OperationResult<bool>>
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Commands;
|
||||
namespace Baya.Application.Features.Order.Commands;
|
||||
|
||||
public record AddOrderCommand( string OrderName) : IRequest<OperationResult<bool>>,
|
||||
IValidatableModel<AddOrderCommand>
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Contracts.Persistence;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Persistence;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Commands;
|
||||
namespace Baya.Application.Features.Order.Commands;
|
||||
|
||||
public class DeleteUserOrdersCommandHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteUserOrdersCommand,OperationResult<bool>>
|
||||
{
|
||||
@@ -0,0 +1,6 @@
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace Baya.Application.Features.Order.Commands;
|
||||
|
||||
public record DeleteUserOrdersCommand(int UserId):IRequest<OperationResult<bool>>;
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Contracts.Persistence;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Persistence;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Commands;
|
||||
namespace Baya.Application.Features.Order.Commands;
|
||||
|
||||
public class UpdateUserOrderCommandHandler(IUnitOfWork unitOfWork) : IRequestHandler<UpdateUserOrderCommand,OperationResult<bool>>
|
||||
{
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Commands;
|
||||
namespace Baya.Application.Features.Order.Commands;
|
||||
|
||||
public record UpdateUserOrderCommand
|
||||
(int OrderId, string OrderName) : IRequest<OperationResult<bool>>,IValidatableModel<UpdateUserOrderCommand>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace Baya.Application.Features.Order.Queries.GetAllOrders;
|
||||
|
||||
public record GetAllOrdersQuery():IRequest<OperationResult<List<GetAllOrdersQueryResult>>>;
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Contracts.Persistence;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Persistence;
|
||||
using Baya.Application.Models.Common;
|
||||
using MapsterMapper;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Queries.GetAllOrders
|
||||
namespace Baya.Application.Features.Order.Queries.GetAllOrders
|
||||
{
|
||||
internal class GetAllOrdersQueryHandler(IUnitOfWork unitOfWork, IMapper mapper)
|
||||
: IRequestHandler<GetAllOrdersQuery, OperationResult<List<GetAllOrdersQueryResult>>>
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
using Mapster;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Queries.GetAllOrders;
|
||||
namespace Baya.Application.Features.Order.Queries.GetAllOrders;
|
||||
|
||||
public record GetAllOrdersQueryResult(int OrderId, string OrderName, int OrderOwnerId, string OrderOwnerUserName);
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Contracts.Persistence;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Persistence;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Queries.GetUserOrders;
|
||||
namespace Baya.Application.Features.Order.Queries.GetUserOrders;
|
||||
|
||||
internal class GetUserOrdersQueryHandler(IUnitOfWork unitOfWork)
|
||||
: IRequestHandler<GetUserOrdersQueryModel, OperationResult<List<GetUsersQueryResultModel>>>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Queries.GetUserOrders;
|
||||
namespace Baya.Application.Features.Order.Queries.GetUserOrders;
|
||||
|
||||
public record GetUserOrdersQueryModel(int UserId) : IRequest<OperationResult<List<GetUsersQueryResultModel>>>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
namespace Baya.Application.Features.Order.Queries.GetUserOrders;
|
||||
|
||||
public record GetUsersQueryResultModel(int OrderId, string OrderName);
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Identity;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Identity;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Commands.AddRoleCommand
|
||||
namespace Baya.Application.Features.Role.Commands.AddRoleCommand
|
||||
{
|
||||
internal class AddRoleCommandHandler(IRoleManagerService roleManagerService)
|
||||
: IRequestHandler<AddRoleCommand, OperationResult<bool>>
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Commands.AddRoleCommand;
|
||||
namespace Baya.Application.Features.Role.Commands.AddRoleCommand;
|
||||
|
||||
public record AddRoleCommand(string RoleName) : IRequest<OperationResult<bool>>,
|
||||
IValidatableModel<AddRoleCommand>
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Identity;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Identity;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Commands.UpdateRoleClaimsCommand
|
||||
namespace Baya.Application.Features.Role.Commands.UpdateRoleClaimsCommand
|
||||
{
|
||||
internal class UpdateRoleClaimsCommandHandler(IRoleManagerService roleManagerService)
|
||||
: IRequestHandler<UpdateRoleClaimsCommand, OperationResult<bool>>
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
|
||||
namespace Baya.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
|
||||
|
||||
public record UpdateRoleClaimsCommand( int RoleId, List<string> RoleClaimValue):IRequest<OperationResult<bool>>;
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Queries.GetAllRolesQuery
|
||||
namespace Baya.Application.Features.Role.Queries.GetAllRolesQuery
|
||||
{
|
||||
internal class GetAllRolesQueryHandler(IRoleManagerService roleManagerService)
|
||||
: IRequestHandler<GetAllRolesQuery, OperationResult<List<GetAllRolesQueryResponse>>>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
namespace Baya.Application.Features.Role.Queries.GetAllRolesQuery;
|
||||
|
||||
public record GetAllRolesQueryResponse(int RoleId,string RoleName);
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace Baya.Application.Features.Role.Queries.GetAllRolesQuery;
|
||||
|
||||
public record GetAllRolesQuery():IRequest<OperationResult<List<GetAllRolesQueryResponse>>>;
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery
|
||||
namespace Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery
|
||||
{
|
||||
internal class GetAuthorizableRoutesQueryHandler(IRoleManagerService roleManagerService)
|
||||
: IRequestHandler<GetAuthorizableRoutesQuery, OperationResult<List<GetAuthorizableRoutesQueryResponse>>>
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
namespace CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
|
||||
namespace Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
|
||||
|
||||
public record GetAuthorizableRoutesQueryResponse(string RouteKey,string AreaName,string ControllerName,string ActionName,string ControllerDescription);
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
|
||||
namespace Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
|
||||
|
||||
public record GetAuthorizableRoutesQuery():IRequest<OperationResult<List<GetAuthorizableRoutesQueryResponse>>>;
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Domain.Entities.User;
|
||||
using MapsterMapper;
|
||||
using Mediator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Commands.Create;
|
||||
namespace Baya.Application.Features.Users.Commands.Create;
|
||||
|
||||
internal class UserCreateCommandHandler(
|
||||
IAppUserManager userManager,
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Features.Users.Commands.Create;
|
||||
namespace Baya.Application.Features.Users.Commands.Create;
|
||||
|
||||
public class UserCreateCommandResult
|
||||
{
|
||||
+5
-5
@@ -1,12 +1,12 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Domain.Entities.User;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Commands.Create;
|
||||
namespace Baya.Application.Features.Users.Commands.Create;
|
||||
|
||||
public record UserCreateCommand
|
||||
(string UserName, string Name, string FamilyName, string PhoneNumber,string Password,string RepeatPassword)
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Contracts;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using Baya.Application.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Commands.RefreshUserTokenCommand
|
||||
namespace Baya.Application.Features.Users.Commands.RefreshUserTokenCommand
|
||||
{
|
||||
internal class RefreshUserTokenCommandHandler(IJwtService jwtService)
|
||||
: IRequestHandler<RefreshUserTokenCommand, OperationResult<AccessToken>>
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Commands.RefreshUserTokenCommand;
|
||||
namespace Baya.Application.Features.Users.Commands.RefreshUserTokenCommand;
|
||||
|
||||
public record RefreshUserTokenCommand(Guid RefreshToken) : IRequest<OperationResult<AccessToken>>,
|
||||
IValidatableModel<RefreshUserTokenCommand>
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Commands.RequestLogout
|
||||
namespace Baya.Application.Features.Users.Commands.RequestLogout
|
||||
{
|
||||
internal class RequestLogoutCommandHandler(IAppUserManager userManager)
|
||||
: IRequestHandler<RequestLogoutCommand, OperationResult<bool>>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace Baya.Application.Features.Users.Commands.RequestLogout;
|
||||
|
||||
public record RequestLogoutCommand(int UserId):IRequest<OperationResult<bool>>;
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Contracts;
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using CleanArc.SharedKernel.Extensions;
|
||||
using Baya.Application.Contracts;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Baya.SharedKernel.Extensions;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.GenerateUserToken;
|
||||
namespace Baya.Application.Features.Users.Queries.GenerateUserToken;
|
||||
|
||||
internal class GenerateUserTokenQueryHandler(IJwtService jwtService, IAppUserManager userManager)
|
||||
: IRequestHandler<GenerateUserTokenQuery, OperationResult<AccessToken>>
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.GenerateUserToken;
|
||||
namespace Baya.Application.Features.Users.Queries.GenerateUserToken;
|
||||
|
||||
public record GenerateUserTokenQuery(string UserKey, string Code) : IRequest<OperationResult<AccessToken>>,
|
||||
IValidatableModel<GenerateUserTokenQuery>
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Domain.Entities.User;
|
||||
using MapsterMapper;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.GetUsers;
|
||||
namespace Baya.Application.Features.Users.Queries.GetUsers;
|
||||
|
||||
internal class GetUsersQueryHandler(IAppUserManager userManager, IMapper mapper)
|
||||
: IRequestHandler<GetUsersQuery, OperationResult<List<GetUsersQueryResponse>>>
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Domain.Entities.User;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.GetUsers;
|
||||
namespace Baya.Application.Features.Users.Queries.GetUsers;
|
||||
|
||||
public record GetUsersQueryResponse
|
||||
{
|
||||
@@ -0,0 +1,6 @@
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace Baya.Application.Features.Users.Queries.GetUsers;
|
||||
|
||||
public record GetUsersQuery : IRequest<OperationResult<List<GetUsersQueryResponse>>>;
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
using CleanArc.Application.Contracts;
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using Baya.Application.Contracts;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
|
||||
namespace Baya.Application.Features.Users.Queries.TokenRequest;
|
||||
|
||||
public class PasswordUserTokenRequestQueryResult
|
||||
(IAppUserManager userManager,IJwtService jwtService)
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Application.Models.Jwt;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
|
||||
namespace Baya.Application.Features.Users.Queries.TokenRequest;
|
||||
|
||||
public record PasswordUserTokenRequestQuery
|
||||
(string UserName,string Password)
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
using CleanArc.Application.Contracts.Identity;
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Baya.Application.Contracts.Identity;
|
||||
using Baya.Application.Models.Common;
|
||||
using Mediator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
|
||||
namespace Baya.Application.Features.Users.Queries.TokenRequest;
|
||||
|
||||
public class UserTokenRequestQueryHandler(
|
||||
IAppUserManager userManager,
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
|
||||
namespace Baya.Application.Features.Users.Queries.TokenRequest;
|
||||
|
||||
public class UserTokenRequestQueryResponse
|
||||
{
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using CleanArc.SharedKernel.ValidationBase;
|
||||
using CleanArc.SharedKernel.ValidationBase.Contracts;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.SharedKernel.ValidationBase;
|
||||
using Baya.SharedKernel.ValidationBase.Contracts;
|
||||
using FluentValidation;
|
||||
using Mediator;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
|
||||
namespace Baya.Application.Features.Users.Queries.TokenRequest;
|
||||
|
||||
public record UserTokenRequestQuery(string UserPhoneNumber) : IRequest<OperationResult<UserTokenRequestQueryResponse>>,
|
||||
IValidatableModel<UserTokenRequestQuery>
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using System.Diagnostics;
|
||||
using CleanArc.SharedKernel.Extensions;
|
||||
using Baya.SharedKernel.Extensions;
|
||||
|
||||
namespace CleanArc.Application.Models.ApiResult;
|
||||
namespace Baya.Application.Models.ApiResult;
|
||||
|
||||
public class ApiResult
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CleanArc.Application.Models.ApiResult;
|
||||
namespace Baya.Application.Models.ApiResult;
|
||||
|
||||
public enum ApiResultStatusCode
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Models.Common;
|
||||
namespace Baya.Application.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Marker Interface To Mark Operation Result Response In Validation Pipeline
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Models.Identity;
|
||||
namespace Baya.Application.Models.Identity;
|
||||
|
||||
public class ActionDescriptionDto
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Models.Identity;
|
||||
namespace Baya.Application.Models.Identity;
|
||||
|
||||
public class CreateRoleDto
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Application.Models.Identity;
|
||||
namespace Baya.Application.Models.Identity;
|
||||
|
||||
public class EditRolePermissionsDto
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Domain.Entities.User;
|
||||
|
||||
namespace CleanArc.Application.Models.Identity;
|
||||
namespace Baya.Application.Models.Identity;
|
||||
|
||||
public class GetRolesDto
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Domain.Entities.User;
|
||||
using Baya.Domain.Entities.User;
|
||||
|
||||
namespace CleanArc.Application.Models.Identity;
|
||||
namespace Baya.Application.Models.Identity;
|
||||
|
||||
public class RolePermissionDto
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
|
||||
namespace CleanArc.Application.Models.Jwt;
|
||||
namespace Baya.Application.Models.Jwt;
|
||||
|
||||
public class AccessToken
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CleanArc.Application.Models.Jwt;
|
||||
namespace Baya.Application.Models.Jwt;
|
||||
|
||||
public class TokenRequest
|
||||
{
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
using System.Reflection;
|
||||
using CleanArc.Application.Common;
|
||||
using Baya.Application.Common;
|
||||
using Mapster;
|
||||
using Mediator;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace CleanArc.Application.ServiceConfiguration;
|
||||
namespace Baya.Application.ServiceConfiguration;
|
||||
|
||||
public static class ServiceCollectionExtension
|
||||
{
|
||||
@@ -13,7 +13,7 @@ public static class ServiceCollectionExtension
|
||||
services.AddMediator(options =>
|
||||
{
|
||||
options.ServiceLifetime = ServiceLifetime.Scoped;
|
||||
options.Namespace = "CleanArc.Application.Mediator";
|
||||
options.Namespace = "Baya.Application.Mediator";
|
||||
});
|
||||
|
||||
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(MetricsBehaviour<,>));
|
||||
+1
-1
@@ -6,6 +6,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Shared\CleanArc.SharedKernel\CleanArc.SharedKernel.csproj" />
|
||||
<ProjectReference Include="..\..\Shared\Baya.SharedKernel\Baya.SharedKernel.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace CleanArc.Domain.Common;
|
||||
namespace Baya.Domain.Common;
|
||||
|
||||
public interface IEntity
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
|
||||
namespace CleanArc.Domain.Entities.Order;
|
||||
namespace Baya.Domain.Entities.Order;
|
||||
|
||||
public class Order:BaseEntity
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class Role:IdentityRole<int>,IEntity
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class RoleClaim:IdentityRoleClaim<int>,IEntity
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class User:IdentityUser<int>,IEntity
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class UserClaim:IdentityUserClaim<int>,IEntity
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class UserLogin:IdentityUserLogin<int>,IEntity
|
||||
{
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class UserRefreshToken:BaseEntity<Guid>
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class UserRole : IdentityUserRole<int>,IEntity
|
||||
{
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using CleanArc.Domain.Common;
|
||||
using Baya.Domain.Common;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace CleanArc.Domain.Entities.User;
|
||||
namespace Baya.Domain.Entities.User;
|
||||
|
||||
public class UserToken:IdentityUserToken<int>,IEntity
|
||||
{
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
using CleanArc.Application.Models.Jwt;
|
||||
|
||||
namespace CleanArc.Application.Features.Admin.Queries.GetToken;
|
||||
|
||||
public record AdminGetTokenQueryResult(AccessToken Token,string[] Roles);
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Commands;
|
||||
|
||||
public record DeleteUserOrdersCommand(int UserId):IRequest<OperationResult<bool>>;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Order.Queries.GetAllOrders;
|
||||
|
||||
public record GetAllOrdersQuery():IRequest<OperationResult<List<GetAllOrdersQueryResult>>>;
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
namespace CleanArc.Application.Features.Order.Queries.GetUserOrders;
|
||||
|
||||
public record GetUsersQueryResultModel(int OrderId, string OrderName);
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
namespace CleanArc.Application.Features.Role.Queries.GetAllRolesQuery;
|
||||
|
||||
public record GetAllRolesQueryResponse(int RoleId,string RoleName);
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Role.Queries.GetAllRolesQuery;
|
||||
|
||||
public record GetAllRolesQuery():IRequest<OperationResult<List<GetAllRolesQueryResponse>>>;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Commands.RequestLogout;
|
||||
|
||||
public record RequestLogoutCommand(int UserId):IRequest<OperationResult<bool>>;
|
||||
@@ -1,6 +0,0 @@
|
||||
using CleanArc.Application.Models.Common;
|
||||
using Mediator;
|
||||
|
||||
namespace CleanArc.Application.Features.Users.Queries.GetUsers;
|
||||
|
||||
public record GetUsersQuery : IRequest<OperationResult<List<GetUsersQueryResponse>>>;
|
||||
Reference in New Issue
Block a user