import type { RegisteredDatabaseUserAttributes } from "lucia";

export enum UserRole {
	ADMIN = "admin",
	USER = "user",
	GUEST = "guest",
}

/**
 * @deprecated
 */
export function hasRole(user: RegisteredDatabaseUserAttributes | null | undefined, role: UserRole) {
	return user?.role === role;
}

/**
 * @deprecated
 */
export function translateUserRole(role: UserRole) {
	switch (role) {
		case UserRole.ADMIN:
			return "Administrator";
		case UserRole.USER:
			return "Benutzer";
		case UserRole.GUEST:
			return "Gast";
	}
}
