Adds front-end set-up

This commit is contained in:
2026-06-20 17:04:17 +02:00
parent efd1569c26
commit 7dfc3a9692
62 changed files with 6875 additions and 3 deletions
+43
View File
@@ -0,0 +1,43 @@
// Domain types shared across the frontend. Names align with backend payloads
// (the user property is `name`, never `naam`) — see BR-U1-10.
// Roles aligned with backend authorization.
export type UserRole = 'Owner' | 'Administrator' | 'User';
export interface User {
id: string; // UUID
email: string;
name: string;
role: UserRole;
isActive: boolean;
}
export interface AuthResponse {
accessToken: string; // JWT access token
expiresAt: string; // ISO timestamp
user: User;
}
export interface LoginRequest {
email: string;
password: string;
}
// RFC 9457 ProblemDetails for standardized error handling.
export interface ProblemDetails {
type?: string;
title?: string;
status?: number;
detail?: string;
instance?: string;
// Extension members (e.g. traceId, errors).
[extension: string]: unknown;
}
// Convenience wrapper for API results (optional usage).
export type ApiResult<T> = { ok: true; data: T } | { ok: false; error: ProblemDetails };
// Setup status (used by guards during bootstrap).
export interface SetupStatus {
initialized: boolean;
}