Scaffold vertical-slice migration: Shared.Contracts, Shared.Application, MediatR

Begins the move to vertical-slice architecture. ResponseBody moves out of
API.Core into Shared.Contracts so slices won't have to depend on the API
host project for it. Shared.Application adds the MediatR pipeline's
ValidationBehavior plus the cross-slice email commands that Features.Auth
will send and Features.Emails will handle, keeping slices decoupled from
each other.
This commit is contained in:
Aaron Po
2026-06-19 23:23:10 -04:00
parent e07b46fcce
commit 62d682472e
16 changed files with 115 additions and 8 deletions

View File

@@ -0,0 +1,29 @@
namespace Shared.Contracts;
/// <summary>
/// Generic envelope used to wrap API responses that carry a data payload alongside a human-readable message.
/// </summary>
/// <typeparam name="T">The type of the data payload returned in the response.</typeparam>
public record ResponseBody<T>
{
/// <summary>
/// A human-readable message describing the outcome of the request.
/// </summary>
public required string Message { get; init; }
/// <summary>
/// The data payload associated with the response.
/// </summary>
public required T Payload { get; init; }
}
/// <summary>
/// Envelope used to wrap API responses that carry only a human-readable message and no data payload.
/// </summary>
public record ResponseBody
{
/// <summary>
/// A human-readable message describing the outcome of the request.
/// </summary>
public required string Message { get; init; }
}