using CMSDAL.DTO.Content; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using System; using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CMSDAL.CustomCode.Content { public interface IContentDAL { Task GetContent(int ContentId, LoginDTO LoginDTO); Task GetContentBySlug(string Slug, LoginDTO LoginDTO); Task GetSelectListContent(int FirstNumber, int MaxResult, CriteriaDTO CriteriaDTO, LoginDTO LoginDTO, bool IsCount = false); // Transaction-aware — must be called from inside ExecuteSaveAsync's persistFunc so the // Content row and its outbox/event-publish commit or roll back together. Returns the // Content's PK (new identity on insert, dto.ContentId echoed back on update) per the // persistFunc: Func> contract. Task SaveContent(ContentDTO ContentDTO, LoginDTO LoginDTO, DbTransaction? tx = null, CancellationToken ct = default); Task UpdateContent(ContentDTO ContentDTO, LoginDTO LoginDTO, DbTransaction? tx = null, CancellationToken ct = default); Task DeleteContent(int ContentId, LoginDTO LoginDTO); Task GetContentListAsync(int spaceId, int contentTypeId, int contentStatus, int authorId, DateTime? fromDate, DateTime? toDate, LoginDTO loginDTO); Task SearchContentAsync(string searchText, int spaceId, int contentTypeId, LoginDTO loginDTO); // Transaction-aware — used from ContentBLL's workflow-transition ExecuteSaveAsync // persistFunc so the status flip and its ContentVersion snapshot are atomic. Task UpdateContentStatusAsync(int contentId, byte status, LoginDTO loginDTO, DbTransaction? tx = null, CancellationToken ct = default); Task UpdateContentStatusWithPublishAsync(int contentId, byte status, LoginDTO loginDTO, DbTransaction? tx = null, CancellationToken ct = default); Task GetContentStatusAsync(int contentId, LoginDTO loginDTO, DbTransaction? tx = null, CancellationToken ct = default); } }