using Domain.Entities; namespace Features.Breweries.Repository; /// /// Defines persistence operations for brewery posts. /// public interface IBreweryRepository { /// /// Gets a brewery post and its location data by identifier. /// Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); /// /// Gets the identifier of the user who created a brewery post. /// Task GetPostedByIdAsync(Guid id, CancellationToken cancellationToken = default); /// /// Gets brewery posts ordered by creation time, with optional paging. /// /// /// Limits returned posts; applies no limit. /// /// /// Skips returned posts; skips none. /// Task> GetAllAsync(int? limit, int? offset); /// /// Gets located brewery posts within a radius, ordered by distance. /// /// /// Sets the point from which distance is measured. /// /// /// Sets the maximum search distance in metres. /// Task> GetAllLocationsWithinRange( CoordinateData coords, double rangeInMetres ); /// /// Gets brewery posts with location data. /// Task> GetAllLocations(); /// /// Saves a brewery post and its location using optimistic concurrency. /// /// /// Thrown if the brewery post or its requested city cannot be found. /// /// /// Thrown if the supplied row version is no longer current. /// Task UpdateAsync( BreweryPost brewery, CancellationToken cancellationToken = default ); /// /// Deletes a brewery post and its dependent records. /// /// /// Thrown if the brewery post cannot be found. /// Task DeleteAsync(Guid id); /// /// Creates a brewery post and its required location. /// /// /// Thrown if has no location. /// /// /// Thrown if the posting user or location city cannot be found. /// Task CreateAsync(BreweryPost brewery); }