import type { AdminRole, PermissionModule, RolePermissionMatrix, AssignedRoleUser, RoleApiScope, RoleActivityLog } from "@/types/roles"
import i18n from "@/lib/i18n";

export const MOCK_ROLES: AdminRole[] = [
  { id: "1", code: "super_admin", name: i18n.t('lib.mock.roles.text_1'), description: i18n.t('lib.mock.roles.text_2'), user_count: 2, is_privileged: true },
  { id: "2", code: "operations_admin", name: i18n.t('lib.mock.roles.text_3'), description: i18n.t('lib.mock.roles.text_4'), user_count: 5, is_privileged: false },
  { id: "3", code: "compliance_officer", name: i18n.t('lib.mock.roles.text_5'), description: i18n.t('lib.mock.roles.text_6'), user_count: 3, is_privileged: false },
  { id: "4", code: "finance_admin", name: i18n.t('lib.mock.roles.text_7'), description: i18n.t('lib.mock.roles.text_8'), user_count: 2, is_privileged: false },
  { id: "5", code: "support_agent", name: i18n.t('lib.mock.roles.text_9'), description: i18n.t('lib.mock.roles.text_10'), user_count: 8, is_privileged: false },
]

export const PERMISSION_MODULES: PermissionModule[] = [
  { id: "1", key: "dashboard", label: i18n.t('lib.mock.roles.text_11') },
  { id: "2", key: "customers", label: i18n.t('lib.mock.roles.text_12') },
  { id: "3", key: "kyc", label: i18n.t('lib.mock.roles.text_13') },
  { id: "4", key: "orders", label: i18n.t('lib.mock.roles.text_14') },
  { id: "5", key: "inventory", label: i18n.t('lib.mock.roles.text_15') },
  { id: "6", key: "ledger", label: i18n.t('lib.mock.roles.text_16') },
  { id: "7", key: "audit_logs", label: i18n.t('lib.mock.roles.text_17') },
]

export const MOCK_PERMISSIONS: RolePermissionMatrix[] = [
  { role_id: "1", module_key: "dashboard", permissions: { view: true, create: true, edit: true, delete: true, export: true, execute_approve: true } },
  { role_id: "1", module_key: "customers", permissions: { view: true, create: true, edit: true, delete: true, export: true, execute_approve: true } },
  { role_id: "2", module_key: "dashboard", permissions: { view: true, create: false, edit: true, delete: false, export: true, execute_approve: false } },
  { role_id: "2", module_key: "customers", permissions: { view: true, create: true, edit: true, delete: false, export: true, execute_approve: false } },
  { role_id: "3", module_key: "kyc", permissions: { view: true, create: false, edit: true, delete: false, export: true, execute_approve: true } },
  { role_id: "4", module_key: "ledger", permissions: { view: true, create: false, edit: true, delete: false, export: true, execute_approve: false } },
  { role_id: "5", module_key: "customers", permissions: { view: true, create: false, edit: false, delete: false, export: false, execute_approve: false } },
]

export const MOCK_ASSIGNED_USERS: Record<string, AssignedRoleUser[]> = {
  "1": [
    { id: "u1", full_name: i18n.t('lib.mock.roles.text_18'), email: "ahmed@goldwallet.com", department: i18n.t('lib.mock.roles.text_19'), location: i18n.t('lib.mock.roles.text_20'), status: "active", last_login: "2026-05-20T10:30:00Z", otp_enabled: true, allowed_ip_status: "verified" },
    { id: "u2", full_name: i18n.t('lib.mock.roles.text_21'), email: "fatima@goldwallet.com", department: i18n.t('lib.mock.roles.text_22'), location: i18n.t('lib.mock.roles.text_23'), status: "active", last_login: "2026-05-19T15:00:00Z", otp_enabled: true, allowed_ip_status: "any" },
  ],
  "2": [
    { id: "u3", full_name: i18n.t('lib.mock.roles.text_24'), email: "khaled@goldwallet.com", department: i18n.t('lib.mock.roles.text_25'), location: i18n.t('lib.mock.roles.text_26'), status: "active", last_login: "2026-05-21T08:00:00Z", otp_enabled: true, allowed_ip_status: "any" },
  ],
}

export const MOCK_API_SCOPES: Record<string, RoleApiScope[]> = {
  "1": [
    { id: "s1", name: i18n.t('lib.mock.roles.text_27'), description: i18n.t('lib.mock.roles.text_28'), access_level: "admin", risk_level: "low", approval_required: false },
    { id: "s2", name: i18n.t('lib.mock.roles.text_29'), description: i18n.t('lib.mock.roles.text_30'), access_level: "admin", risk_level: "high", approval_required: true },
  ],
  "2": [
    { id: "s3", name: i18n.t('lib.mock.roles.text_31'), description: i18n.t('lib.mock.roles.text_32'), access_level: "read", risk_level: "low", approval_required: false },
  ],
}

export const MOCK_ACTIVITY_LOGS: RoleActivityLog[] = [
  { id: "l1", actor_name: i18n.t('lib.mock.roles.text_33'), action: i18n.t('lib.mock.roles.text_34'), target: i18n.t('lib.mock.roles.text_35'), timestamp: "2026-05-22T14:30:00Z", risk_level: "medium", metadata: { module: "roles", old_value: "view_only", new_value: "view_edit" } },
  { id: "l2", actor_name: i18n.t('lib.mock.roles.text_36'), action: i18n.t('lib.mock.roles.text_37'), target: i18n.t('lib.mock.roles.text_38'), timestamp: "2026-05-21T09:15:00Z", risk_level: "low" },
  { id: "l3", actor_name: i18n.t('lib.mock.roles.text_39'), action: i18n.t('lib.mock.roles.text_40'), target: i18n.t('lib.mock.roles.text_41'), timestamp: "2026-05-20T16:45:00Z", risk_level: "low" },
]