|
- using Campaign_Tracker.Server.LegacyData.Models;
-
- namespace Campaign_Tracker.Server.LegacyData;
-
- /// <summary>
- /// Anti-corruption layer contract for read-only access to legacy Access-derived entities.
- ///
- /// Design invariants enforced by this interface (AC #2, AC #4):
- /// - This interface exposes NO write methods (no Insert/Update/Delete/Remove/Modify).
- /// - All callers MUST use this interface; no code outside this namespace may query
- /// legacy tables directly.
- /// - All returned types are strongly-typed read-only domain records (AC #3).
- /// - Join keys (ID, JCode/JurisCode, KitID) are the only navigation paths (AC #1).
- /// </summary>
- public interface ILegacyDataAccess
- {
- // ── Jurisdiction queries (join key: JCode / JurisCode) ──────────────────
-
- Task<LegacyJurisdiction?> GetJurisdictionAsync(
- string jCode,
- CancellationToken cancellationToken = default);
-
- Task<IReadOnlyList<LegacyJurisdiction>> GetAllJurisdictionsAsync(
- CancellationToken cancellationToken = default);
-
- // ── Contact queries (join keys: ID, JURISCODE) ───────────────────────────
-
- Task<LegacyContact?> GetContactByIdAsync(
- int id,
- CancellationToken cancellationToken = default);
-
- Task<IReadOnlyList<LegacyContact>> GetContactsByJurisdictionAsync(
- string jCode,
- CancellationToken cancellationToken = default);
-
- // ── Kit queries (join keys: ID, Jcode) ───────────────────────────────────
-
- Task<LegacyKit?> GetKitByIdAsync(
- int id,
- CancellationToken cancellationToken = default);
-
- Task<IReadOnlyList<LegacyKit>> GetKitsByJurisdictionAsync(
- string jCode,
- CancellationToken cancellationToken = default);
-
- // ── KitLabel queries (join key: KitID) ───────────────────────────────────
-
- Task<IReadOnlyList<LegacyKitLabel>> GetKitLabelsByKitAsync(
- int kitId,
- CancellationToken cancellationToken = default);
- }
|