feat: add case + party CRUD with case events (Phase 1B)

- CaseService: list (paginated, filterable), get detail (with parties,
  events, deadline count), create, update, soft-delete (archive)
- PartyService: list by case, create, update, delete
- Auto-create case_events on case creation, status change, party add,
  and case archive
- Auth middleware now resolves tenant_id from user_tenants table
- All operations scoped to tenant_id from auth context
This commit is contained in:
m
2026-03-25 13:26:50 +01:00
parent 8049ea3c63
commit f11c411147
8 changed files with 778 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ func main() {
}
defer database.Close()
authMW := auth.NewMiddleware(cfg.SupabaseJWTSecret)
authMW := auth.NewMiddleware(cfg.SupabaseJWTSecret, database)
handler := router.New(database, authMW)
log.Printf("Starting KanzlAI API server on :%s", cfg.Port)