Spensara Spensara Knowledge Base & Documentation Repository

Repository Docs & Knowledge Base

Consolidated Spensara documentation repository (722 Markdown & architecture documents in ../repository)
Built Word Documents (.docx): Spensara Overview (.docx) Capability Assessment (.docx) Brink POS Ingestion Analysis (.docx) The Borg Ingestion Architecture (.docx)

Implementation Specs (157)

Detailed engineering and feature implementation specifications.
implementation-specs/specs/BackendDatabaseConsolidation/TASK2.2.md 1,449 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

TASK 2.2: Add backend customer API key and audit log persistence

Summary

Move Laravel-owned customer API keys and activity logs into backend persistence.

Dependencies

  • TASK 2.1 complete

Files to Modify

Likely files:

  • backend/Kds.Ai.Data/KdsAiDbContext.cs
  • new entity files under backend/Kds.Ai.Data/Entities
  • new repositories/services under backend/Kds.Ai.Data
  • new EF migration under backend/Kds.Ai.Data/Migrations
  • backend/Kds.Ai.Data/DependencyInjectionExtensions.cs

Required Behavior

The backend must own:

  • customer API keys currently stored in Laravel,
  • audit/activity logs if the admin UX still requires recent activity visibility.

API key persistence should remain customer-scoped and support secure create, update, read, and delete flows.

Audit logging, if retained, should be written by backend application operations rather than Laravel local model writes.

Acceptance Criteria

  • [ ] Backend has persistence for customer API keys
  • [ ] Backend has persistence for audit logs if retained
  • [ ] EF migration exists for the new tables
  • [ ] DI wiring exists for the new repositories/services
  • [ ] Laravel CustomerApiKey and ActivityLog are no longer required as sources of truth after cutover

Notes

  • Treat secrets carefully. Avoid exposing raw values beyond necessary admin workflows.
  • If activity log retention is not required, explicitly document that before skipping the entity.