mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 09:37:23 +00:00
Auth and Emails land together since Auth's registration/resend flows need Emails to exist first. Service.Auth's four services (Register, Login, Confirmation, Token) collapse into MediatR commands/queries in Features.Auth; TokenService stays as a slice-internal service since multiple handlers call it. Auth no longer references Emails directly — it sends SendRegistrationEmailCommand/SendResendConfirmationEmailCommand (defined in Shared.Application) which Features.Emails handles, so neither slice has a project reference on the other. Service.Emails' IEmailService becomes Features.Emails' IEmailDispatcher, simplified to take (firstName, email, token) instead of a full UserAccount since that's all it ever used. API.Specs' TestApiFactory/MockEmailService are updated to swap in the relocated interface. Also deletes Infrastructure.Repository now that Breweries, UserManagement, and Auth have all moved their repos out of it, and replaces the two now-dead docker-compose test services (repository.tests, service.auth.tests, both pointing at deleted Dockerfiles) with a single unit.tests service that runs every Features.*.Tests project via Dockerfile.tests.
23 lines
1.1 KiB
C#
23 lines
1.1 KiB
C#
using Features.Auth.Dtos;
|
|
using MediatR;
|
|
|
|
namespace Features.Auth.Commands.RegisterUser;
|
|
|
|
/// <summary>
|
|
/// Registers a new user account. Bound directly from the request body of <c>POST /api/auth/register</c>.
|
|
/// </summary>
|
|
/// <param name="Username">The desired username; must be 3-64 characters and contain only letters, numbers, dots, underscores, and hyphens.</param>
|
|
/// <param name="FirstName">The user's first name; up to 128 characters.</param>
|
|
/// <param name="LastName">The user's last name; up to 128 characters.</param>
|
|
/// <param name="Email">The user's email address; up to 128 characters and must be a valid email format.</param>
|
|
/// <param name="DateOfBirth">The user's date of birth; the user must be at least 19 years old.</param>
|
|
/// <param name="Password">The desired plaintext password; must be at least 8 characters and contain an uppercase letter, a lowercase letter, a number, and a special character.</param>
|
|
public record RegisterUserCommand(
|
|
string Username,
|
|
string FirstName,
|
|
string LastName,
|
|
string Email,
|
|
DateTime DateOfBirth,
|
|
string Password
|
|
) : IRequest<RegistrationPayload>;
|