shoc-backend/SeaHaven.Services/Interfaces/ICompletionDocTemplateService.cs
Alexandre Brandizzi 7c097c2750 feat(completion-templates): author templates with safety note and ordered procedures
Adds an extra safety note and an ordered procedure list to completion
document templates, name search, creator and last-updated audit fields,
a tenant-scoped count of open work orders that depend on a template, and
a delete that unlinks Services while they keep requiring a document.
Writes are gated by the create/edit/delete completion template team
permissions instead of the Admin role.
2026-09-25 11:00:22 -03:00

40 lines
1.5 KiB
C#

using System.Security.Claims;
using Data.SeaHavenIndustries.Enums;
using SeaHaven.Services.DTOs;
namespace SeaHaven.Services.Interfaces
{
/// <summary>
/// Completion document templates registry: authoring (title, extra safety note,
/// ordered procedures), search, and safe deletion. Reads are open to every
/// authenticated caller; writes require the matching team permission.
/// </summary>
public interface ICompletionDocTemplateService
{
Task<IReadOnlyList<CompletionDocTemplateDetailDto>> ListAsync(
string? search,
string? serviceKey,
WorkOrderType? workOrderType,
CancellationToken cancellationToken);
Task<CompletionDocTemplateDetailDto?> GetAsync(int id, CancellationToken cancellationToken);
Task<CompletionDocTemplateLinkedWorkOrdersDto> GetLinkedWorkOrdersAsync(
ClaimsPrincipal user,
int id,
CancellationToken cancellationToken);
Task<CompletionDocTemplateDetailDto> CreateAsync(
ClaimsPrincipal user,
CompletionDocTemplateCreateDto request,
CancellationToken cancellationToken);
Task<CompletionDocTemplateDetailDto> UpdateAsync(
ClaimsPrincipal user,
int id,
CompletionDocTemplateCreateDto request,
CancellationToken cancellationToken);
Task DeleteAsync(ClaimsPrincipal user, int id, CancellationToken cancellationToken);
}
}