Skip to content

Commit

Permalink
Fix folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanderlan Gomes da Silva committed Aug 1, 2024
1 parent 4b7dd3b commit 2cbeaf0
Show file tree
Hide file tree
Showing 32 changed files with 82 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/Company.Orion.Api/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using Microsoft.AspNetCore.Mvc.Razor;
using Company.Orion.Api.Configuration;
using Company.Orion.Application.Core;
using Company.Orion.Application.Core.UseCases.Users.Commands.Create;
using Company.Orion.Crosscutting.Ioc.Dependencies;
using Company.Orion.Domain.Core.Authentication;
using Company.Orion.Application.Core.UseCases.User.Commands.Create;

namespace Company.Orion.Api;

Expand Down
12 changes: 6 additions & 6 deletions src/Company.Orion.Api/Controllers/V1/UsersController.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using Asp.Versioning;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Company.Orion.Application.Core.Commands.UserDelete;
using Company.Orion.Domain.Core.Exceptions;
using Company.Orion.Domain.Core.ValueObjects.Pagination;
using Swashbuckle.AspNetCore.Annotations;
using System.Net;
using Company.Orion.Api.Attributes;
using Company.Orion.Api.Controllers.Base;
using Company.Orion.Application.Core.UseCases.Users.Commands.ChangePassword;
using Company.Orion.Application.Core.UseCases.Users.Commands.Create;
using Company.Orion.Application.Core.UseCases.Users.Commands.Delete;
using Company.Orion.Application.Core.UseCases.Users.Commands.Update;
using Company.Orion.Application.Core.UseCases.Users.Queries.GetById;
using Company.Orion.Application.Core.UseCases.Users.Queries.GetPaginated;
using static Company.Orion.Domain.Core.Authentication.AuthorizationConfiguration;
using Company.Orion.Application.Core.UseCases.User.Commands.Update;
using Company.Orion.Application.Core.UseCases.User.Commands.Create;
using Company.Orion.Application.Core.UseCases.User.Queries.GetPaginated;
using Company.Orion.Application.Core.UseCases.User.Commands.ChangePassword;
using Company.Orion.Application.Core.UseCases.User.Queries.GetById;

namespace Company.Orion.Api.Controllers.V1;

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.ChangePassword
namespace Company.Orion.Application.Core.UseCases.Users.Commands.ChangePassword
{
public class UserChangePasswordRequest : IRequest<Unit>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Company.Orion.Application.Core.Notifications.UserPasswordChanged;
using MediatR;
using Company.Orion.Application.Core.UseCases.Users.Notifications.UserPasswordChanged;
using Company.Orion.Domain.Core.Authentication;
using Company.Orion.Domain.Core.Services.Interfaces;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.ChangePassword
namespace Company.Orion.Application.Core.UseCases.Users.Commands.ChangePassword
{
public class UserUpdatePasswordRequestHandler(
IUserService userService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using FluentValidation;
using Microsoft.Extensions.Localization;
using Company.Orion.Crosscutting.Resources;
using Company.Orion.Crosscutting.Resources.Messages;
using FluentValidation;
using Microsoft.Extensions.Localization;

namespace Company.Orion.Application.Core.UseCases.User.Commands.ChangePassword;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.ChangePassword;

public class UserChangePasswordRequestValidator : AbstractValidator<UserChangePasswordRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using MediatR;
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Create;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Create;

public class UserCreateRequest : IRequest<UserCreateResponse>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Company.Orion.Application.Core.Notifications.UserCreated;
using MediatR;
using Company.Orion.Application.Core.UseCases.Users.Notifications.UserCreated;
using Company.Orion.Domain.Core.Services.Interfaces;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Create;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Create;

public class UserCreateRequestHandler(IUserService userService, IMediator mediator)
: IRequestHandler<UserCreateRequest, UserCreateResponse>
public class UserCreateRequestHandler(IUserService userService, IMediator mediator) : IRequestHandler<UserCreateRequest, UserCreateResponse>
{
public async Task<UserCreateResponse> Handle(UserCreateRequest request, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using FluentValidation;
using Microsoft.Extensions.Localization;
using Company.Orion.Crosscutting.Resources;
using Company.Orion.Crosscutting.Resources.Messages;
using FluentValidation;
using Microsoft.Extensions.Localization;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Create;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Create;

public class UserCreateRequestValidator : AbstractValidator<UserCreateRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Create;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Create;

public class UserCreateResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Delete;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Delete;

public record UserDeleteRequest(string PublicId) : IRequest;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MediatR;
using Company.Orion.Domain.Core.Services.Interfaces;
using Company.Orion.Domain.Core.Services.Interfaces;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Delete;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Delete;

public class UserDeleteRequestHandler(IUserService userService) : IRequestHandler<UserDeleteRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using MediatR;
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Update;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Update;

public class UserUpdateRequest : IRequest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MediatR;
using Company.Orion.Domain.Core.Services.Interfaces;
using Company.Orion.Domain.Core.Services.Interfaces;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Update;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Update;

public class UserUpdateRequestHandler(IUserService userService) : IRequestHandler<UserUpdateRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using FluentValidation;
using Microsoft.Extensions.Localization;
using Company.Orion.Crosscutting.Resources;
using Company.Orion.Crosscutting.Resources.Messages;
using FluentValidation;
using Microsoft.Extensions.Localization;

namespace Company.Orion.Application.Core.UseCases.User.Commands.Update;
namespace Company.Orion.Application.Core.UseCases.Users.Commands.Update;

public class UserUpdateRequestValidator : AbstractValidator<UserUpdateRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Company.Orion.Domain.Core.Entities;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.Users.Notifications.UserCreated
{
public class UserCreatedNotification(User user) : INotification
{
public User Entity { get; set; } = user;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MediatR;
using Company.Orion.Domain.Core.Authentication;
using MediatR;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Company.Orion.Domain.Core.Authentication;

namespace Company.Orion.Application.Core.UseCases.User.Notifications.UserCreated
namespace Company.Orion.Application.Core.UseCases.Users.Notifications.UserCreated
{
public class UserCreatedNotificationHandler(
ILogger<UserCreatedNotificationHandler> logger,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using MediatR;

namespace Company.Orion.Application.Core.UseCases.Users.Notifications.UserPasswordChanged
{
public class UserPasswordChangedNotification : INotification;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using MediatR;
using Company.Orion.Domain.Core.Authentication;
using MediatR;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Company.Orion.Domain.Core.Authentication;

namespace Company.Orion.Application.Core.UseCases.User.Notifications.UserPasswordChanged
namespace Company.Orion.Application.Core.UseCases.Users.Notifications.UserPasswordChanged
{
public class UserPasswordChangedNotificationHandler(
ILogger<UserPasswordChangedNotificationHandler> logger,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Queries.GetById;
namespace Company.Orion.Application.Core.UseCases.Users.Queries.GetById;

public record UserGetByIdRequest(string PublicId) : IRequest<UserGetByIdResponse>;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MediatR;
using Company.Orion.Domain.Core.Services.Interfaces;
using Company.Orion.Domain.Core.Services.Interfaces;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Queries.GetById;
namespace Company.Orion.Application.Core.UseCases.Users.Queries.GetById;

public class UserGetByIdHandler(IUserService userService) : IRequestHandler<UserGetByIdRequest, UserGetByIdResponse>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;

namespace Company.Orion.Application.Core.UseCases.User.Queries.GetById;
namespace Company.Orion.Application.Core.UseCases.Users.Queries.GetById;

public class UserGetByIdResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MediatR;
using Company.Orion.Domain.Core.Filters;
using Company.Orion.Domain.Core.Filters;
using Company.Orion.Domain.Core.ValueObjects.Pagination;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Queries.GetPaginated;
namespace Company.Orion.Application.Core.UseCases.Users.Queries.GetPaginated;

public class UserGetPaginatedRequest : UserFilter, IRequest<PagedList<UserGetPaginatedResponse>>;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using MediatR;
using Company.Orion.Domain.Core.Services.Interfaces;
using Company.Orion.Domain.Core.Services.Interfaces;
using Company.Orion.Domain.Core.ValueObjects.Pagination;
using MediatR;

namespace Company.Orion.Application.Core.UseCases.User.Queries.GetPaginated;
namespace Company.Orion.Application.Core.UseCases.Users.Queries.GetPaginated;

public class UserGetPaginatedRequestHandler(IUserService userService)
: IRequestHandler<UserGetPaginatedRequest, PagedList<UserGetPaginatedResponse>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;

namespace Company.Orion.Application.Core.UseCases.User.Queries.GetPaginated;
namespace Company.Orion.Application.Core.UseCases.Users.Queries.GetPaginated;

public class UserGetPaginatedResponse
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Company.Orion.Test/Api/V1/AuthApiTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System.Net;
using System.Threading.Tasks;
using Company.Orion.Application.Core.UseCases.Auth.Commands.LoginWithCredentials;
using Company.Orion.Test.Integration.Setup;
using Company.Orion.Test.Shared.Faker;
using Company.Orion.Application.Core.Commands.LoginWithCredentials;
using Xunit;
using Company.Orion.Application.Core.UseCases.User.Commands.Create;
using Company.Orion.Application.Core.UseCases.Auth.Commands.LoginWithRefreshToken;
using Company.Orion.Application.Core.UseCases.Users.Commands.Create;

namespace Company.Orion.Test.Api.V1
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Company.Orion.Test/Api/V1/UsersApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
using System.Net;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Company.Orion.Application.Core.Commands.UserChangePassword;
using Company.Orion.Application.Core.UseCases.Users.Commands.ChangePassword;
using Company.Orion.Application.Core.UseCases.Users.Commands.Create;
using Company.Orion.Application.Core.UseCases.Users.Queries.GetPaginated;
using Company.Orion.Domain.Core.ValueObjects.Pagination;
using Company.Orion.Test.Integration.Setup;
using Company.Orion.Test.Shared.Faker;
using Xunit;
using Company.Orion.Application.Core.UseCases.User.Commands.Create;
using Company.Orion.Application.Core.UseCases.User.Queries.GetPaginated;

namespace Company.Orion.Test.Api.V1
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Company.Orion.Application.Core.Commands.LoginWithCredentials;
using Company.Orion.Application.Core.UseCases.Auth.Commands.LoginWithCredentials;
using Xunit;

namespace Company.Orion.Test.Integration.Setup;
Expand Down
4 changes: 2 additions & 2 deletions tests/Company.Orion.Test/Shared/Faker/UserFaker.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Bogus;
using Company.Orion.Application.Core.UseCases.User.Commands.Create;
using Company.Orion.Application.Core.UseCases.User.Commands.Update;
using Company.Orion.Application.Core.UseCases.Users.Commands.Create;
using Company.Orion.Application.Core.UseCases.Users.Commands.Update;
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;
using Company.Orion.Domain.Core.Extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using Company.Orion.Api.Configuration;
using Company.Orion.Api.Controllers.V1;
using Company.Orion.Api.Models;
using Company.Orion.Application.Core.Commands.LoginWithCredentials;
using Company.Orion.Application.Core.Commands.LoginWithRefreshToken;
using Company.Orion.Domain.Core.Entities;
using Company.Orion.Domain.Core.Entities.Enuns;
using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Company.Orion.Application.Core.UseCases.Users.Queries.GetById;
using Company.Orion.Application.Core.UseCases.Users.Queries.GetPaginated;
using Company.Orion.Test.Shared.Faker;
using Company.Orion.Test.Unit.Controllers.BaseController;
using Xunit;
using Company.Orion.Application.Core.UseCases.User.Queries.GetById;
using Company.Orion.Application.Core.UseCases.User.Queries.GetPaginated;

namespace Company.Orion.Test.Unit.Controllers;

Expand Down

0 comments on commit 2cbeaf0

Please sign in to comment.