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.3.md 1,471 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

TASK 2.3: Merge Laravel uploaded file ownership into backend Document

Summary

Extend backend Document so it fully replaces Laravel UploadedFile responsibilities for dashboard and document-management flows.

Dependencies

  • TASK 2.1 complete

Files to Modify

Likely files:

  • backend/Kds.Ai.Data/Entities/Document.cs
  • backend/Kds.Ai.Data/KdsAiDbContext.cs
  • new EF migration under backend/Kds.Ai.Data/Migrations
  • document repository and endpoint files under backend/Kds.Ai.Data and backend/Kds.Ai.ApiService

Required Behavior

Backend Document ownership must cover the current Laravel use cases:

  • listing recent uploaded documents for the current user or tenant,
  • removing a document,
  • retaining useful file metadata for the UI,
  • associating documents with tenant scope and, if needed, uploader identity,
  • supporting the existing ingest/remove workflow without relying on a separate Laravel table.

Acceptance Criteria

  • [ ] Backend Document model contains the metadata required by current file flows
  • [ ] EF migration exists for any schema changes
  • [ ] Backend can list document metadata needed by the dashboard and file screens
  • [ ] Backend can remove documents without Laravel local DB state
  • [ ] Laravel UploadedFile no longer needs to exist after cutover

Notes

  • Prefer extending Document over introducing another overlapping file entity.
  • Keep field additions minimal and driven by actual UI behavior.