export const TENANT_ROLES = [
    'platform_admin',
    'tenant_owner',
    'tenant_admin',
    'tenant_operator',
    'teacher',
    'sales',
    'agent',
    'student',
];
export const QUESTION_STATUSES = ['draft', 'published', 'archived'];
export const ORDER_STATUSES = ['pending', 'paid', 'failed', 'closed', 'refunded'];
export const ENTITLEMENT_SCOPE_TYPES = ['tenant', 'region', 'module', 'subject', 'question_bank'];
export function normalizeTenantRole(role) {
    const value = String(role || '').toLowerCase();
    if (value === 'superadmin')
        return 'platform_admin';
    if (value === 'admin')
        return 'tenant_admin';
    if (value === 'operator')
        return 'tenant_operator';
    if (TENANT_ROLES.includes(value))
        return value;
    return 'student';
}
export function normalizeOrderStatus(status) {
    const value = String(status || '').toLowerCase();
    if (value === 'paid' || value === 'success')
        return 'paid';
    if (value === 'failed' || value === 'fail')
        return 'failed';
    if (value === 'refunded' || value === 'refund')
        return 'refunded';
    if (value === 'closed' || value === 'cancelled' || value === 'canceled')
        return 'closed';
    return 'pending';
}
