Compare commits

...

4 Commits

Author SHA1 Message Date
m
68d48100b9 test: comprehensive integration tests for all API endpoints
Replace the existing integration test suite with a complete test covering
every registered API route. Tests use httptest with the real router and
a real DB connection (youpc.org mgmt schema).

Endpoint groups tested:
- Health, Auth (JWT validation, expired/invalid/wrong-secret)
- Current user (GET /api/me)
- Tenants (CRUD, auto-assign)
- Cases (CRUD with search/status filters)
- Parties (CRUD)
- Deadlines (CRUD, complete, batch create)
- Appointments (CRUD)
- Notes (CRUD)
- Dashboard
- Proceeding types & deadline rules
- Deadline calculator & determination (timeline, determine)
- Reports (cases, deadlines, workload, billing)
- Templates (CRUD, render)
- Time entries (CRUD, summary)
- Invoices (CRUD, status update)
- Billing rates (list, upsert)
- Notifications (list, unread count, mark read, preferences)
- Audit log (list, filtered)
- Case assignments (assign, unassign)
- Documents (list, meta)
- AI endpoints (availability check)
- Critical path E2E (case -> deadline -> appointment -> note -> time entry -> dashboard -> complete)
2026-03-30 14:41:59 +02:00
m
5e401d2eac fix: default deadline calculator date to today 2026-03-30 14:21:08 +02:00
m
3f90904e0c fix: update search_path from kanzlai to mgmt after migration 2026-03-30 14:18:35 +02:00
m
f285d4451d refactor: switch to youpc.org Supabase, remove separate YouPCDatabaseURL 2026-03-30 14:09:52 +02:00
3 changed files with 1084 additions and 230 deletions

View File

@@ -13,8 +13,8 @@ func Connect(databaseURL string) (*sqlx.DB, error) {
return nil, fmt.Errorf("connecting to database: %w", err) return nil, fmt.Errorf("connecting to database: %w", err)
} }
// Set search_path so queries use kanzlai schema by default // Set search_path so queries use mgmt schema by default
if _, err := db.Exec("SET search_path TO kanzlai, public"); err != nil { if _, err := db.Exec("SET search_path TO mgmt, public"); err != nil {
db.Close() db.Close()
return nil, fmt.Errorf("setting search_path: %w", err) return nil, fmt.Errorf("setting search_path: %w", err)
} }

File diff suppressed because it is too large Load Diff

View File

@@ -35,7 +35,9 @@ const inputClass =
export function DeadlineCalculator() { export function DeadlineCalculator() {
const [proceedingType, setProceedingType] = useState(""); const [proceedingType, setProceedingType] = useState("");
const [triggerDate, setTriggerDate] = useState(""); const [triggerDate, setTriggerDate] = useState(
new Date().toISOString().split("T")[0],
);
const { data: proceedingTypes, isLoading: typesLoading } = useQuery({ const { data: proceedingTypes, isLoading: typesLoading } = useQuery({
queryKey: ["proceeding-types"], queryKey: ["proceeding-types"],