# 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.
