using ECPDAL.Correspondence.DTOs; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; namespace ECPBLL.Correspondence.Interfaces; public interface ICorrespondenceBLL { Task GetCorrespondenceAsync(int correspondenceId, LoginDTO login, CancellationToken ct); Task GetCorrespondenceHistoryAsync(int objectTypeId, int objectId, LoginDTO login, CancellationToken ct); /// Tenant-wide, paged, CriteriaDTO-filterable list -- see ICorrespondenceDAL for the /// supported FieldName set. Returns (serialized item JSON, total matching row count). Task<(string Json, int Total)> GetCorrespondenceListAsync( CriteriaDTO? criteriaDTO, int pageNumber, int pageSize, LoginDTO login, CancellationToken ct); /// Render-only preview — calls IDocumentMergeService, no persistence, no send (plan's /// "preview-then-commit" pattern, same shape as GetMatrixPreview/GetGSTR1Preview/PreviewDocument). Task GetCorrespondencePreviewAsync(CorrespondenceRenderRequestDTO dto, LoginDTO login, CancellationToken ct); /// Persists TCORRESPONDENCE, uploads the merged document via the existing TATTACHMENT/ /// ECM pattern, and queues a TACTIONOUTBOX row (bypassing MACTION rule evaluation — this is an /// explicit user-triggered send, not an automatic event-triggered rule) for /// CorrespondenceActionHandler to pick up. Task SaveAndSendCorrespondenceAsync(SaveAndSendCorrespondenceDTO dto, LoginDTO login, CancellationToken ct); /// Updates editable routing/scheduling fields only (not the generated document or /// object reference). Throws if not found / wrong tenant / stale Version. Task UpdateCorrespondenceAsync(UpdateCorrespondenceDTO dto, LoginDTO login, CancellationToken ct); /// Soft-deletes (STATUS=2). Throws if not found / wrong tenant / already deleted. Task DeleteCorrespondenceAsync(int correspondenceId, LoginDTO login, CancellationToken ct); }