using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using TCMSDAL.DTO; using TCMSDAL.Interfaces; using TCMSDAL.QueryBuilders; namespace TCMSDAL.Implementations; public class TCMSImportDAL : ITCMSImportDAL { private readonly IQueryExecutor _QueryExecutor; public TCMSImportDAL(IQueryExecutor queryExecutor) { _QueryExecutor = queryExecutor; } public async Task GetPieSyncStatusAsync( int moduleId, LoginDTO login, CancellationToken ct) => await _QueryExecutor.QuerySingleAsync( login, TCMSImportQB.GET_PIE_SYNC_STATUS, new { ModuleId = moduleId, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false); public async Task UpsertPieSyncAsync( int moduleId, Guid pieModuleId, int count, LoginDTO login, CancellationToken ct) => await _QueryExecutor.ExecuteAsync( login, TCMSImportQB.UPSERT_PIE_SYNC, new { ModuleId = moduleId, PieModuleId = pieModuleId, ScenariosImported = count, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false); public async Task> GetUATChecklistRowsAsync( int moduleId, int? testRunId, LoginDTO login, CancellationToken ct) => await _QueryExecutor.QueryAsync( login, TCMSImportQB.GET_UAT_CHECKLIST_ROWS, new { ModuleId = moduleId, TestRunId = testRunId, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false) ?? Enumerable.Empty(); }