Files
ScadaBridge/src/ScadaLink.Commons/Interfaces/Repositories/IInboundApiRepository.cs
T
Joseph Doherty 22e1eba58a Phase 0 WP-0.2–0.9: Implement Commons (types, entities, interfaces, messages, protocol, tests)
- WP-0.2: Namespace/folder skeleton (26 directories)
- WP-0.3: Shared data types (6 enums, RetryPolicy, Result<T>)
- WP-0.4: 24 domain entity POCOs across 10 domain areas
- WP-0.5: 7 repository interfaces with full CRUD signatures
- WP-0.6: IAuditService cross-cutting interface
- WP-0.7: 26 message contract records across 8 concern areas
- WP-0.8: IDataConnection protocol abstraction with batch ops
- WP-0.9: 8 architectural constraint enforcement tests
All 40 tests pass, zero warnings.
2026-03-16 18:48:24 -04:00

26 lines
1.5 KiB
C#

using ScadaLink.Commons.Entities.InboundApi;
namespace ScadaLink.Commons.Interfaces.Repositories;
public interface IInboundApiRepository
{
// ApiKey
Task<ApiKey?> GetApiKeyByIdAsync(int id, CancellationToken cancellationToken = default);
Task<IReadOnlyList<ApiKey>> GetAllApiKeysAsync(CancellationToken cancellationToken = default);
Task<ApiKey?> GetApiKeyByValueAsync(string keyValue, CancellationToken cancellationToken = default);
Task AddApiKeyAsync(ApiKey apiKey, CancellationToken cancellationToken = default);
Task UpdateApiKeyAsync(ApiKey apiKey, CancellationToken cancellationToken = default);
Task DeleteApiKeyAsync(int id, CancellationToken cancellationToken = default);
// ApiMethod
Task<ApiMethod?> GetApiMethodByIdAsync(int id, CancellationToken cancellationToken = default);
Task<IReadOnlyList<ApiMethod>> GetAllApiMethodsAsync(CancellationToken cancellationToken = default);
Task<ApiMethod?> GetMethodByNameAsync(string name, CancellationToken cancellationToken = default);
Task<IReadOnlyList<ApiKey>> GetApprovedKeysForMethodAsync(int methodId, CancellationToken cancellationToken = default);
Task AddApiMethodAsync(ApiMethod method, CancellationToken cancellationToken = default);
Task UpdateApiMethodAsync(ApiMethod method, CancellationToken cancellationToken = default);
Task DeleteApiMethodAsync(int id, CancellationToken cancellationToken = default);
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
}