using EntitlementDAL.DTOs; using GB5Shared.DTO.Framework.Login; namespace EntitlementDAL.Interfaces; public interface IAgreementDAL { Task GetTypeByCodeAsync(string typeCode, LoginDTO login, CancellationToken ct); Task InsertTypeAsync(AgreementTypeDTO dto, LoginDTO login, CancellationToken ct); /// Admin authoring list (tracker §51.13) — every real agreement type. Task> GetTypeListAsync(LoginDTO login, CancellationToken ct); /// Resolves the currently-applicable Published version bundle for the given /// AgreementTypeCodes and jurisdiction — one version per type, preferring a /// jurisdiction-specific override over the universal default. Task> GetApplicableVersionsAsync( IEnumerable typeCodes, string jurisdictionCode, LoginDTO login, CancellationToken ct); Task GetVersionByIdAsync(int agreementVersionId, LoginDTO login, CancellationToken ct); /// Admin authoring list (tracker §51.13) — every version ever created for one type, /// newest EffectiveFrom first, so full Draft/Published/Superseded/Retired history is visible. Task> GetVersionListByTypeAsync(int agreementTypeId, LoginDTO login, CancellationToken ct); /// Every currently-Published version of a RequiresIndividualAcceptance=1 type /// (e.g. an Enterprise Clickwrap EULA) — one per type, jurisdiction-preferring. Task> GetRequiredIndividualVersionsAsync(string jurisdictionCode, LoginDTO login, CancellationToken ct); Task InsertVersionAsync(AgreementVersionDTO dto, LoginDTO login, CancellationToken ct); Task UpdateVersionStatusAsync(int agreementVersionId, byte versionStatus, int modifiedById, DateTime modifiedOn, LoginDTO login, CancellationToken ct); /// Draft → Published specifically — sets VersionStatus and ContentHash together so /// the hash is never left uncommitted after a successful publish. Task PublishVersionAsync(int agreementVersionId, string? contentHash, int modifiedById, DateTime modifiedOn, LoginDTO login, CancellationToken ct); Task InsertAcceptanceAsync(AgreementAcceptanceDTO dto, LoginDTO login, CancellationToken ct); Task> GetAcceptancesBySubjectAsync(byte subjectType, int subjectId, LoginDTO login, CancellationToken ct); }