mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
Rename auth feature to Features.Users (#281)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Account.DeleteAccount;
|
||||
namespace Features.Users.Commands.Account.DeleteAccount;
|
||||
|
||||
/// <summary>Permanently deletes the given user account.</summary>
|
||||
/// <param name="UserAccountId">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Users.Identity;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Account.DeleteAccount;
|
||||
namespace Features.Users.Commands.Account.DeleteAccount;
|
||||
|
||||
/// <summary>Handles <see cref="DeleteAccountCommand" /> by deleting the user via <see cref="UserManager{TUser}" />.</summary>
|
||||
public class DeleteAccountHandler(UserManager<ApplicationUser> userManager)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdateEmail;
|
||||
namespace Features.Users.Commands.Account.UpdateEmail;
|
||||
|
||||
/// <summary>
|
||||
/// Changes the email address of the given user account. The account's <c>EmailConfirmed</c> status
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdateEmail;
|
||||
namespace Features.Users.Commands.Account.UpdateEmail;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="UpdateEmailCommand" /> via <see cref="UserManager{TUser}" />.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdateEmail;
|
||||
namespace Features.Users.Commands.Account.UpdateEmail;
|
||||
|
||||
/// <summary>Validates <see cref="UpdateEmailCommand" />, mirroring the email rules in <c>RegisterUserValidator</c>.</summary>
|
||||
public class UpdateEmailValidator : AbstractValidator<UpdateEmailCommand>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdatePassword;
|
||||
namespace Features.Users.Commands.Account.UpdatePassword;
|
||||
|
||||
/// <summary>Changes the password of the given user account, verifying the current password first.</summary>
|
||||
/// <param name="UserAccountId">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdatePassword;
|
||||
namespace Features.Users.Commands.Account.UpdatePassword;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="UpdatePasswordCommand" /> via <see cref="UserManager{TUser}.ChangePasswordAsync" />,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdatePassword;
|
||||
namespace Features.Users.Commands.Account.UpdatePassword;
|
||||
|
||||
/// <summary>Validates <see cref="UpdatePasswordCommand" />, mirroring the password rules in <c>RegisterUserValidator</c>.</summary>
|
||||
public class UpdatePasswordValidator : AbstractValidator<UpdatePasswordCommand>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdateUsername;
|
||||
namespace Features.Users.Commands.Account.UpdateUsername;
|
||||
|
||||
/// <summary>Changes the username of the given user account.</summary>
|
||||
/// <param name="UserAccountId">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdateUsername;
|
||||
namespace Features.Users.Commands.Account.UpdateUsername;
|
||||
|
||||
/// <summary>Handles <see cref="UpdateUsernameCommand" /> via <see cref="UserManager{TUser}" />.</summary>
|
||||
public class UpdateUsernameHandler(UserManager<ApplicationUser> userManager)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Account.UpdateUsername;
|
||||
namespace Features.Users.Commands.Account.UpdateUsername;
|
||||
|
||||
/// <summary>Validates <see cref="UpdateUsernameCommand" />, mirroring the username rules in <c>RegisterUserValidator</c>.</summary>
|
||||
public class UpdateUsernameValidator : AbstractValidator<UpdateUsernameCommand>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.ConfirmUser;
|
||||
namespace Features.Users.Commands.Authentication.ConfirmUser;
|
||||
|
||||
/// <summary>Validates a confirmation token and confirms the corresponding user account.</summary>
|
||||
public record ConfirmUserCommand(string Token) : IRequest<ConfirmationPayload>;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Auth.Services;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using Features.Users.Services;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.ConfirmUser;
|
||||
namespace Features.Users.Commands.Authentication.ConfirmUser;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="ConfirmUserCommand" /> by validating the confirmation token and marking the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.Login;
|
||||
namespace Features.Users.Commands.Authentication.Login;
|
||||
|
||||
/// <summary>
|
||||
/// Authenticates a user using their username and password and issues new tokens. Bound directly
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Auth.Services;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using Features.Users.Services;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.Login;
|
||||
namespace Features.Users.Commands.Authentication.Login;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="LoginCommand" /> by verifying credentials via
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.Login;
|
||||
namespace Features.Users.Commands.Authentication.Login;
|
||||
|
||||
/// <summary>Validates that <see cref="LoginCommand.Username" /> and <see cref="LoginCommand.Password" /> are present.</summary>
|
||||
public class LoginValidator : AbstractValidator<LoginCommand>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.RefreshToken;
|
||||
namespace Features.Users.Commands.Authentication.RefreshToken;
|
||||
|
||||
/// <summary>
|
||||
/// Exchanges a valid refresh token for a new access/refresh token pair. Constructed from the
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Services;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Services;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.RefreshToken;
|
||||
namespace Features.Users.Commands.Authentication.RefreshToken;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="RefreshTokenCommand" /> by validating the refresh token and issuing a new
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.RefreshToken;
|
||||
namespace Features.Users.Commands.Authentication.RefreshToken;
|
||||
|
||||
/// <summary>Validates that <see cref="RefreshTokenCommand.RefreshToken" /> is present.</summary>
|
||||
public class RefreshTokenValidator : AbstractValidator<RefreshTokenCommand>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.RegisterUser;
|
||||
namespace Features.Users.Commands.Authentication.RegisterUser;
|
||||
|
||||
/// <summary>
|
||||
/// Registers a new user account. Bound directly from the request body of <c>POST /api/auth/register</c>.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using Domain.Entities;
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Commands.Profile.CreateUserProfile;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Auth.Notifications;
|
||||
using Features.Auth.Services;
|
||||
using Features.Users.Commands.Profile.CreateUserProfile;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using Features.Users.Notifications;
|
||||
using Features.Users.Services;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.RegisterUser;
|
||||
namespace Features.Users.Commands.Authentication.RegisterUser;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="RegisterUserCommand" />: creates the user via <see cref="UserManager{TUser}" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.RegisterUser;
|
||||
namespace Features.Users.Commands.Authentication.RegisterUser;
|
||||
|
||||
/// <summary>
|
||||
/// Validates the field-level constraints on <see cref="RegisterUserCommand" />: username format and
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.ResendConfirmationEmail;
|
||||
namespace Features.Users.Commands.Authentication.ResendConfirmationEmail;
|
||||
|
||||
/// <summary>Resends the account confirmation email to a user, generating a fresh confirmation token.</summary>
|
||||
public record ResendConfirmationEmailCommand(Guid UserId) : IRequest;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Features.Auth.Identity;
|
||||
using Features.Auth.Notifications;
|
||||
using Features.Auth.Services;
|
||||
using Features.Users.Identity;
|
||||
using Features.Users.Notifications;
|
||||
using Features.Users.Services;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Authentication.ResendConfirmationEmail;
|
||||
namespace Features.Users.Commands.Authentication.ResendConfirmationEmail;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="ResendConfirmationEmailCommand" /> by generating a fresh confirmation token and
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.CreateUserProfile;
|
||||
namespace Features.Users.Commands.Profile.CreateUserProfile;
|
||||
|
||||
/// <summary>Creates a new user profile for a user account.</summary>
|
||||
public record CreateUserProfileCommand(Guid UserAccountId, string Biography) : IRequest<Guid>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Repository;
|
||||
using Features.Users.Repository;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.CreateUserProfile;
|
||||
namespace Features.Users.Commands.Profile.CreateUserProfile;
|
||||
|
||||
/// <summary>Handles <see cref="CreateUserProfileCommand" /> by inserting the new profile record.</summary>
|
||||
public class CreateUserProfileHandler(IUserProfileRepository userProfileRepository)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UpdateBiography;
|
||||
namespace Features.Users.Commands.Profile.UpdateBiography;
|
||||
|
||||
/// <summary>Updates the biography of the given user account's profile.</summary>
|
||||
/// <param name="UserAccountId">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Repository;
|
||||
using Features.Users.Repository;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UpdateBiography;
|
||||
namespace Features.Users.Commands.Profile.UpdateBiography;
|
||||
|
||||
/// <summary>Handles <see cref="UpdateBiographyCommand" /> by updating the stored biography.</summary>
|
||||
public class UpdateBiographyHandler(IUserProfileRepository userProfileRepository)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Users.Dtos;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UpdateProfile;
|
||||
namespace Features.Users.Commands.Profile.UpdateProfile;
|
||||
|
||||
/// <summary>
|
||||
/// Updates the non-credential profile fields (first name, last name, date of birth) of the given
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Domain.Exceptions;
|
||||
using Features.Auth.Dtos;
|
||||
using Features.Auth.Identity;
|
||||
using Features.Users.Dtos;
|
||||
using Features.Users.Identity;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UpdateProfile;
|
||||
namespace Features.Users.Commands.Profile.UpdateProfile;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="UpdateProfileCommand" /> via <see cref="UserManager{TUser}" />. First/last name
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UpdateProfile;
|
||||
namespace Features.Users.Commands.Profile.UpdateProfile;
|
||||
|
||||
/// <summary>Validates <see cref="UpdateProfileCommand" />, mirroring the profile rules in <c>RegisterUserValidator</c>.</summary>
|
||||
public class UpdateProfileValidator : AbstractValidator<UpdateProfileCommand>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UploadAvatar;
|
||||
namespace Features.Users.Commands.Profile.UploadAvatar;
|
||||
|
||||
/// <summary>Uploads a new avatar photo for a user account, replacing any existing avatar.</summary>
|
||||
public record UploadAvatarCommand(Guid UserAccountId, IFormFile File) : IRequest<Guid>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Domain.Entities;
|
||||
using Features.Auth.Repository;
|
||||
using Features.ImageUploads.Commands.UploadPhoto;
|
||||
using Features.Users.Repository;
|
||||
using MediatR;
|
||||
|
||||
namespace Features.Auth.Commands.Profile.UploadAvatar;
|
||||
namespace Features.Users.Commands.Profile.UploadAvatar;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="UploadAvatarCommand" />: uploads the photo via <see cref="UploadPhotoCommand" />,
|
||||
|
||||
Reference in New Issue
Block a user