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