using System.Data; using System.Data.Common; using GB5Shared.DTO.Framework.Login; using GB5Shared.ResponseStandard; using SwDAL.DTO.ClientDatabase; using SwDAL.DTO.DbServer; namespace SwDAL.CustomCode.ClientDatabase; public interface IClientDatabaseDAL { Task GetById(int clientDbId, LoginDTO loginDTO, CancellationToken ct); /// Resolves the ClientDatabase row (if any) for a raw DbServerId+DatabaseName pair. /// Returns null when no ClientDatabase is registered for that pair (e.g. exploratory /// browsing of a database that hasn't been provisioned through SqlWorkbench). Task GetByServerAndDatabaseName(int dbServerId, string databaseName, LoginDTO loginDTO, CancellationToken ct); Task GetSelectListClientDatabase(int first, int max, LoginDTO loginDTO); Task> SaveClientDatabase(ClientDatabaseDTO dto, LoginDTO loginDTO, DbTransaction tx, CancellationToken ct); Task> UpdateClientDatabase(ClientDatabaseDTO dto, LoginDTO loginDTO, DbTransaction tx, CancellationToken ct); Task> UpdateStatus(int clientDbId, byte clientDbStatus, LoginDTO loginDTO, DbTransaction tx, CancellationToken ct); /// Plain UPDATE (no transaction) — DeliveryMode is operational/config metadata /// (tracker §53), not a business-entity mutation needing the full ExecuteSaveAsync pipeline. Task UpdateDeliveryMode(int clientDbId, byte deliveryMode, LoginDTO loginDTO, CancellationToken ct); Task> DeleteClientDatabase(int clientDbId, LoginDTO loginDTO, DbTransaction tx, CancellationToken ct); /// Records where each of the three contained-user credentials was written in Vault /// (never the plaintext password itself) after ClientDatabaseProvisioner creates them. Task> UpdateCredentialVaultPaths( int clientDbId, string dbaVaultPath, string appVaultPath, string readOnlyVaultPath, LoginDTO loginDTO, DbTransaction tx, CancellationToken ct); /// Records which MSERVERCONFIG row (framework-level, different ID space) this /// database was registered as. Task> UpdateServerConfigId( int clientDbId, int serverConfigId, LoginDTO loginDTO, DbTransaction tx, CancellationToken ct); /// Finds the sibling Main-role row's ServerConfigId for the same tenant/DbModel — /// used when provisioning a Report/Archive database to know which MSERVERCONFIG row to link /// ReportServerConfigId/ArchiveServerConfigId against. Task GetMainServerConfigIdForModel(int dbModelId, LoginDTO loginDTO, CancellationToken ct); }