/**
 * Static fallback module + permission list for the Internal Role Builder.
 * Used when the backend /api/admin/permissions endpoint is unavailable (e.g. preview mode).
 * Synthetic IDs follow the pattern "static:{module}:{action}".
 */

export type Permission = { id: string; module: string; action: string };

const ACTIONS = ['Read', 'Create', 'Update', 'Delete'] as const;

const ADMIN_MODULES = [
  'Users',
  'Employees',
  'Companies',
  'Candidates',
  'Customers',
  'Photographers',
  'MakeupArtists',
  'Tutors',
  'Developers',
  'VideoEditors',
  'FitnessTrainers',
  'CateringServices',
  'GraphicDesigners',
  'SocialMediaManagers',
  'Roles',
  'RuntimeRoles',
  'Approvals',
  'Departments',
  'Designations',
  'InternalDashboards',
  'ExternalDashboards',
  'Jobs',
  'Leads',
  'Pricing',
  'Credits',
  'Coupons',
  'Discounts',
  'Taxes',
  'Orders',
  'Invoices',
  'Reviews',
  'Support',
  'Reports',
  'Ledger',
  'KnowledgeBase',
  'Notifications',
  'Financial',
  'Settings',
];

export const STATIC_PERMISSIONS: Permission[] = ADMIN_MODULES.flatMap((mod) =>
  ACTIONS.map((action) => ({
    id: `static:${mod}:${action}`,
    module: mod,
    action,
  })),
);
