// src/app.d.ts

declare global {
	namespace App {
		// Define the User structure matching your Java Entity
		interface User {
			id: string;
			firstName?: string;
			lastName?: string;
			birthDate?: string;
			email: string;
			contact?: string;
			groups: {
				id: string;
				name: string;
				permissions: string[];
			}[];
			enabled: boolean;
			createdAt: string;
		}

		interface Locals {
			user?: User; // locals.user is optional (undefined if not logged in)
		}

		interface PageData {
			user?: User; // Available in $page.data.user
		}

		interface Error {
			message: string;
			errorId?: string;
		}
	}
}

export {};
