Adds front-end set-up
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user