using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using IceImportDAL.DTO.IceImportRun; namespace IceImportDAL.CustomCode.IceImportRun; // Every method takes LoginDTO because IQueryExecutor needs it purely for connection resolution // (login.DatabaseName/DatabaseType) — not because every table has a TENANTID column. // TICEIMPORTRUNLOG/ARTIFACT/ROWRESULT have no TENANTID column at all (per the Phase 0 migration); // tenant isolation for those is enforced one layer up, in IceImportRunBLL, by first calling // GetByIdAsync (which DOES filter TENANTID) before ever touching a child table for a given RunId — // same discipline AutomationBLL.Run.RunBLL uses for AUTO.TRUNLOG/TRUNARTIFACT. public interface IIceImportRunDAL { Task InsertRunAsync( int iceMapId, string? triggeredBy, int? sourceProfileId, long? retryOfRunId, LoginDTO login, CancellationToken ct); Task UpdateSourceFileArtifactAsync(long runId, long artifactId, LoginDTO login, CancellationToken ct); Task UpdateStageAsync(long runId, string currentStage, LoginDTO login, CancellationToken ct); Task CompleteRunAsync( long runId, string status, int rowTotalCount, int successCount, int failedCount, string? errorMessage, LoginDTO login, CancellationToken ct); Task CancelRunAsync(long runId, LoginDTO login, CancellationToken ct); Task InsertLogAsync(long runId, string logLevel, string message, LoginDTO login, CancellationToken ct); Task InsertArtifactAsync(long runId, string artifactType, string storageKey, LoginDTO login, CancellationToken ct); Task InsertRowResultsAsync(long runId, IEnumerable results, LoginDTO login, CancellationToken ct); Task GetByIdAsync(long runId, LoginDTO login, CancellationToken ct); Task> GetLogsAsync(long runId, LoginDTO login, CancellationToken ct); Task> GetArtifactsAsync(long runId, LoginDTO login, CancellationToken ct); Task GetLatestArtifactByTypeAsync( long runId, string artifactType, LoginDTO login, CancellationToken ct); Task> GetHistoryAsync( int iceMapId, int offset, int pageSize, LoginDTO login, CancellationToken ct); Task> GetRowErrorsAsync( long runId, string? status, int offset, int pageSize, LoginDTO login, CancellationToken ct); }