mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
update features docs
This commit is contained in:
@@ -3,9 +3,6 @@ using MediatR;
|
||||
|
||||
namespace Features.Breweries.Commands.CreateBrewery;
|
||||
|
||||
/// <summary>
|
||||
/// Location data required to create a new brewery post, supplied as part of <see cref="CreateBreweryCommand" />.
|
||||
/// </summary>
|
||||
public record CreateBreweryLocation(
|
||||
Guid CityId,
|
||||
string AddressLine1,
|
||||
|
||||
@@ -5,19 +5,10 @@ using MediatR;
|
||||
|
||||
namespace Features.Breweries.Commands.CreateBrewery;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="CreateBreweryCommand" /> by persisting a new brewery post and its location.
|
||||
/// </summary>
|
||||
/// <param name="repository">Repository used to persist the new brewery post.</param>
|
||||
public class CreateBreweryHandler(IBreweryRepository repository)
|
||||
: IRequestHandler<CreateBreweryCommand, BreweryDto>
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new brewery post, generating new identifiers for the post and its location.
|
||||
/// </summary>
|
||||
/// <param name="request">The details of the brewery post to create.</param>
|
||||
/// <param name="cancellationToken">A token to observe for cancellation requests.</param>
|
||||
/// <returns>The newly created brewery post.</returns>
|
||||
/// <summary>Creates a new brewery post, generating new identifiers for the post and its location.</summary>
|
||||
public async Task<BreweryDto> Handle(
|
||||
CreateBreweryCommand request,
|
||||
CancellationToken cancellationToken
|
||||
|
||||
@@ -2,17 +2,8 @@ using FluentValidation;
|
||||
|
||||
namespace Features.Breweries.Commands.CreateBrewery;
|
||||
|
||||
/// <summary>
|
||||
/// Validates <see cref="CreateBreweryCommand" /> instances before they are processed.
|
||||
/// </summary>
|
||||
public class CreateBreweryValidator : AbstractValidator<CreateBreweryCommand>
|
||||
{
|
||||
/// <summary>
|
||||
/// Configures validation rules requiring <see cref="CreateBreweryCommand.PostedById" />,
|
||||
/// <see cref="CreateBreweryCommand.BreweryName" />, <see cref="CreateBreweryCommand.Description" />, and
|
||||
/// <see cref="CreateBreweryCommand.Location" /> to be present, with length limits on the name, description,
|
||||
/// address line 1, and postal code fields.
|
||||
/// </summary>
|
||||
public CreateBreweryValidator()
|
||||
{
|
||||
RuleFor(x => x.PostedById).NotEmpty().WithMessage("PostedById is required.");
|
||||
|
||||
Reference in New Issue
Block a user