export const loginResponses = {
  init: {
    email: {
      success: true,
      status: 'pending_password',
      process_token: 'pt_123',
      application: {
        id: 12,
        name: 'Sofisticard',
        logo: 'https://...',
      },
      user: {
        reference: 'usr_xxx',
        name: 'Alioune Diop',
        email: 'al***@domain.com',
      },
      prompt: {
        title: "Autoriser l'acces",
        message: 'Sofisticard souhaite acceder a votre compte',
        actions: ['grant_access', 'cancel'],
      },
    },
    phone: {
      success: true,
      status: 'pending_otp',
      process_token: 'pt_124',
      application: {
        id: 12,
        name: 'Sofisticard',
        logo: 'https://...',
      },
      user: {
        reference: 'usr_xxx',
        name: 'Alioune Diop',
        phone: '+221 ****567',
      },
      otp_method: 'sms',
      otp_sent_to: '+221 ****567',
      prompt: {
        title: "Verifier le code",
        message: 'Un code a ete envoye par SMS',
        actions: ['grant_access', 'cancel'],
      },
    },
    needsAccess: {
      success: true,
      needs_access: true,
      status: 'needs_access',
      process_token: 'pt_125',
      application: {
        id: 12,
        name: 'Sofisticard',
        logo: 'https://...',
      },
      user: {
        reference: 'usr_xxx',
        name: 'Alioune Diop',
        email: 'al***@domain.com',
      },
      prompt: {
        title: "Autoriser l'acces",
        message: 'Sofisticard souhaite acceder a votre compte',
        actions: ['grant_access', 'cancel'],
      },
    },
    errors: {
      validation_error: {
        success: false,
        error_type: 'validation_error',
        message: 'Donnees invalides',
      },
      invalid_app: {
        success: false,
        error_type: 'invalid_app',
        message: 'Application non trouvee',
      },
      invalid_token: {
        success: false,
        error_type: 'invalid_token',
        message: 'Session expiree ou invalide',
      },
      email_not_found: {
        success: false,
        error_type: 'email_not_found',
        message: 'Aucun compte trouve avec cet email',
      },
      phone_not_found: {
        success: false,
        error_type: 'phone_not_found',
        message: 'Aucun compte trouve avec ce numero',
      },
    },
  },

  validate: {
    callbackSuccess: {
      success: true,
      callback_token: 'ct_abc',
      expires_at: '2026-06-08T12:45:00Z',
    },
    requires2fa: {
      success: true,
      requires_2fa: true,
      status: 'pending_2fa',
      process_token: 'pt_126',
    },
    needsAccess: {
      success: true,
      needs_access: true,
      status: 'needs_access',
      process_token: 'pt_127',
      application: {
        id: 12,
        name: 'Sofisticard',
        logo: 'https://...',
      },
      user: {
        reference: 'usr_xxx',
        name: 'Alioune Diop',
        email: 'al***@domain.com',
      },
      prompt: {
        title: "Autoriser l'acces",
        message: 'Sofisticard souhaite acceder a votre compte',
        actions: ['grant_access', 'cancel'],
      },
    },
    errors: {
      invalid_token: {
        success: false,
        error_type: 'invalid_token',
        message: 'Session expiree ou invalide',
      },
      invalid_status: {
        success: false,
        error_type: 'invalid_status',
        message: 'Statut de session invalide',
      },
      invalid_password: {
        success: false,
        error_type: 'invalid_password',
        message: 'Mot de passe incorrect',
        remaining_attempts: 2,
      },
      invalid_otp: {
        success: false,
        error_type: 'invalid_otp',
        message: 'Code incorrect',
        remaining_attempts: 2,
      },
      invalid_totp: {
        success: false,
        error_type: 'invalid_totp',
        message: 'Code 2FA invalide',
        attempts_remaining: 2,
      },
      max_attempts: {
        success: false,
        error_type: 'max_attempts',
        message: 'Trop de tentatives. Veuillez recommencer.',
      },
      user_not_found: {
        success: false,
        error_type: 'user_not_found',
        message: 'Utilisateur non trouve',
      },
      alias_not_found: {
        success: false,
        error_type: 'alias_not_found',
        message: 'Alias non trouve',
      },
    },
  },

  grantAccess: {
    success: {
      success: true,
      callback_token: 'ct_abc',
      expires_at: '2026-06-08T12:45:00Z',
    },
    errors: {
      invalid_token: {
        success: false,
        error_type: 'invalid_token',
        message: 'Session expiree ou invalide',
      },
      invalid_status: {
        success: false,
        error_type: 'invalid_status',
        message: "Cette session n'est pas en attente d'acces",
      },
      user_not_found: {
        success: false,
        error_type: 'user_not_found',
        message: 'Utilisateur non trouve',
      },
      alias_not_found: {
        success: false,
        error_type: 'alias_not_found',
        message: 'Alias non trouve',
      },
      server_error: {
        success: false,
        error_type: 'server_error',
        message: 'Erreur serveur interne',
      },
    },
  },

  accessOtp: {
    success: {
      success: true,
      callback_token: 'ct_abc',
      expires_at: '2026-06-08T12:45:00Z',
    },
    needsAccess: {
      success: true,
      needs_access: true,
      status: 'needs_access',
      process_token: 'pt_128',
      application: {
        id: 12,
        name: 'Sofisticard',
        logo: 'https://...',
      },
      user: {
        id: 55,
        name: 'Alioune Diop',
        email: 'al***@domain.com',
      },
      prompt: {
        title: "Autoriser l'acces",
        message: 'Sofisticard souhaite acceder a votre compte',
        actions: ['grant_access', 'cancel'],
      },
    },
    errors: {
      invalid_token: {
        success: false,
        error_type: 'invalid_token',
        message: 'Session expiree ou invalide',
      },
      invalid_status: {
        success: false,
        error_type: 'invalid_status',
        message: 'Statut de session invalide',
      },
      invalid_otp: {
        success: false,
        error_type: 'invalid_otp',
        message: 'Code incorrect',
      },
      max_attempts: {
        success: false,
        error_type: 'max_attempts',
        message: 'Trop de tentatives. Veuillez recommencer.',
      },
      user_not_found: {
        success: false,
        error_type: 'user_not_found',
        message: 'Utilisateur non trouve',
      },
    },
  },

  verifyTotp: {
    success: {
      success: true,
      callback_token: 'ct_abc',
      expires_at: '2026-06-08T12:45:00Z',
    },
    pending2fa: {
      success: true,
      requires_2fa: true,
      status: 'pending_2fa',
      process_token: 'pt_129',
    },
    errors: {
      invalid_token: {
        success: false,
        error_type: 'invalid_token',
        message: 'Session expiree ou invalide',
      },
      invalid_status: {
        success: false,
        error_type: 'invalid_status',
        message: "Cette session n'attend pas de code 2FA",
      },
      invalid_totp: {
        success: false,
        error_type: 'invalid_totp',
        message: 'Code 2FA invalide',
      },
      max_attempts: {
        success: false,
        error_type: 'max_attempts',
        message: 'Trop de tentatives. Veuillez recommencer.',
      },
      user_not_found: {
        success: false,
        error_type: 'user_not_found',
        message: 'Utilisateur non trouve',
      },
    },
  },

  resendOtp: {
    success: {
      success: true,
      otp_code: '482913',
      sent: true,
      cooldown_remaining: 60,
    },
    errors: {
      invalid_token: {
        success: false,
        error_type: 'invalid_token',
        message: 'Session expiree ou invalide',
      },
      invalid_status: {
        success: false,
        error_type: 'invalid_status',
        message: 'Statut de session invalide',
      },
      resend_cooldown: {
        success: false,
        error_type: 'resend_cooldown',
        message: 'Veuillez patienter avant de renvoyer',
        wait_seconds: 30,
      },
      validation_error: {
        success: false,
        error_type: 'validation_error',
        message: 'Donnees invalides',
      },
    },
  },
} as const;
