Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

52 lines
2.1KB

  1. using Campaign_Tracker.Server.LegacyData.Models;
  2. namespace Campaign_Tracker.Server.LegacyData;
  3. /// <summary>
  4. /// Anti-corruption layer contract for read-only access to legacy Access-derived entities.
  5. ///
  6. /// Design invariants enforced by this interface (AC #2, AC #4):
  7. /// - This interface exposes NO write methods (no Insert/Update/Delete/Remove/Modify).
  8. /// - All callers MUST use this interface; no code outside this namespace may query
  9. /// legacy tables directly.
  10. /// - All returned types are strongly-typed read-only domain records (AC #3).
  11. /// - Join keys (ID, JCode/JurisCode, KitID) are the only navigation paths (AC #1).
  12. /// </summary>
  13. public interface ILegacyDataAccess
  14. {
  15. // ── Jurisdiction queries (join key: JCode / JurisCode) ──────────────────
  16. Task<LegacyJurisdiction?> GetJurisdictionAsync(
  17. string jCode,
  18. CancellationToken cancellationToken = default);
  19. Task<IReadOnlyList<LegacyJurisdiction>> GetAllJurisdictionsAsync(
  20. CancellationToken cancellationToken = default);
  21. // ── Contact queries (join keys: ID, JURISCODE) ───────────────────────────
  22. Task<LegacyContact?> GetContactByIdAsync(
  23. int id,
  24. CancellationToken cancellationToken = default);
  25. Task<IReadOnlyList<LegacyContact>> GetContactsByJurisdictionAsync(
  26. string jCode,
  27. CancellationToken cancellationToken = default);
  28. // ── Kit queries (join keys: ID, Jcode) ───────────────────────────────────
  29. Task<LegacyKit?> GetKitByIdAsync(
  30. int id,
  31. CancellationToken cancellationToken = default);
  32. Task<IReadOnlyList<LegacyKit>> GetKitsByJurisdictionAsync(
  33. string jCode,
  34. CancellationToken cancellationToken = default);
  35. // ── KitLabel queries (join key: KitID) ───────────────────────────────────
  36. Task<IReadOnlyList<LegacyKitLabel>> GetKitLabelsByKitAsync(
  37. int kitId,
  38. CancellationToken cancellationToken = default);
  39. }

Powered by TurnKey Linux.