2026-08-04 10:21:47 -03:00
|
|
|
using System.Security.Claims;
|
2026-07-13 13:13:00 -03:00
|
|
|
using Data.SeaHavenIndustries.Enums;
|
|
|
|
|
using SeaHaven.Services.DTOs;
|
|
|
|
|
|
|
|
|
|
namespace SeaHaven.Services.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IWorkOrderMediaService
|
|
|
|
|
{
|
2026-08-04 14:14:37 -03:00
|
|
|
Task<IReadOnlyList<WorkOrderMediaFileDto>?> GetMediaAsync(
|
|
|
|
|
int workOrderId,
|
|
|
|
|
ClaimsPrincipal user,
|
|
|
|
|
string? actorId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
2026-08-04 09:30:09 -03:00
|
|
|
|
2026-09-08 11:19:41 -03:00
|
|
|
Task<WorkOrderMediaContentDto> GetMediaContentAsync(
|
|
|
|
|
int workOrderId,
|
|
|
|
|
int mediaId,
|
|
|
|
|
ClaimsPrincipal user,
|
|
|
|
|
string? actorId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-08-04 09:30:09 -03:00
|
|
|
/// <summary>
|
|
|
|
|
/// Authorizes the caller and validates the work order is mutable before any blob storage write.
|
|
|
|
|
/// </summary>
|
2026-08-04 10:21:47 -03:00
|
|
|
Task EnsureCanMutateMediaAsync(
|
|
|
|
|
int workOrderId,
|
|
|
|
|
ClaimsPrincipal user,
|
|
|
|
|
string? actorId,
|
2026-08-24 09:31:30 -03:00
|
|
|
CancellationToken cancellationToken = default,
|
|
|
|
|
WorkOrderMediaCategory? category = null);
|
2026-08-04 09:30:09 -03:00
|
|
|
|
2026-07-31 11:58:22 -03:00
|
|
|
Task<WorkOrderMediaFileDto> AddMediaAsync(
|
|
|
|
|
int workOrderId,
|
|
|
|
|
WorkOrderMediaCategory? category,
|
|
|
|
|
string fileUrl,
|
2026-08-04 10:21:47 -03:00
|
|
|
ClaimsPrincipal user,
|
2026-08-04 09:30:09 -03:00
|
|
|
string? actorId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-07-31 11:58:22 -03:00
|
|
|
Task<WorkOrderMediaFileDto> UpdateMediaCategoryAsync(
|
|
|
|
|
int workOrderId,
|
|
|
|
|
int mediaId,
|
|
|
|
|
WorkOrderMediaCategory category,
|
2026-08-04 09:30:09 -03:00
|
|
|
string? workOrderVersion,
|
2026-08-04 10:21:47 -03:00
|
|
|
ClaimsPrincipal user,
|
2026-08-04 09:30:09 -03:00
|
|
|
string? actorId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
Task DeleteMediaAsync(
|
|
|
|
|
int workOrderId,
|
|
|
|
|
int mediaId,
|
|
|
|
|
string? workOrderVersion,
|
2026-08-04 10:21:47 -03:00
|
|
|
ClaimsPrincipal user,
|
2026-08-04 09:30:09 -03:00
|
|
|
string? actorId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
2026-07-13 13:13:00 -03:00
|
|
|
}
|
|
|
|
|
}
|