/**
 * Datos de referencia — permisos `ref_invoice_types.*` (seed_v2.py `permissions_reference`).
 * Solo lectura en seed actual; `action` reservado por si se amplía el CRUD.
 * Tipos de factura
 */
import type { User } from '$lib/auth';
import { userHasPermission } from '$lib/auth';

export type InvoiceTypesRefAction = 'view';

export function userHasInvoiceTypesRefAction(user: User | null, action: InvoiceTypesRefAction): boolean {
	return userHasPermission(user, `ref_invoice_types.${action}`);
}
