mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Enforce brewery ownership on update and delete (#267)
This commit is contained in:
@@ -11,7 +11,13 @@ public interface IBreweryRepository
|
||||
/// Retrieves a brewery post by ID, joined to its location. Returns <c>null</c> if no brewery post
|
||||
/// exists with the given ID, or if it has no associated location.
|
||||
/// </summary>
|
||||
Task<BreweryPost?> GetByIdAsync(Guid id);
|
||||
Task<BreweryPost?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the <c>PostedById</c> of the brewery post with the given ID, without joining its
|
||||
/// location. Returns <c>null</c> if no brewery post exists with the given ID.
|
||||
/// </summary>
|
||||
Task<Guid?> GetPostedByIdAsync(Guid id, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all brewery posts, optionally paginated, ordered by creation date descending. Posts
|
||||
@@ -50,7 +56,7 @@ public interface IBreweryRepository
|
||||
/// Thrown when <paramref name="brewery" />'s <c>RowVersion</c> no longer matches the stored row (it was
|
||||
/// modified by another request since it was last read).
|
||||
/// </exception>
|
||||
Task<BreweryPost> UpdateAsync(BreweryPost brewery);
|
||||
Task<BreweryPost> UpdateAsync(BreweryPost brewery, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>Deletes a brewery post by ID. Its location and photos are removed via cascading foreign keys.</summary>
|
||||
/// <exception cref="Domain.Exceptions.NotFoundException">Thrown when no brewery exists with the given <paramref name="id" />.</exception>
|
||||
|
||||
Reference in New Issue
Block a user