// enum APPSTATUS {
//   loading,
//   unAuthenticated,
//   authenticated,
//   unverified,
// }

enum AuthMethodTypesEnum {
  sms,
  whatsApp,
  fingerPrint,
  faceID,
  moreOptions,
}

enum ViewStateEnum {
  hide,
  idle,
  busy,
  error,
  busyLocal,
  errorLocal,
}

enum CountryEnum { saudiArabia, unitedArabEmirates }

enum SelectionTypeEnum { dropdown, calendar }

enum GenderTypeEnum { male, female }

enum MaritalStatusTypeEnum { single, married, divorced, widowed }

enum ChipTypeEnum { success, error, alert, info, warning }

enum OTPTypeEnum { sms, whatsapp }

enum LoginTypeEnum { sms, whatsapp, face, fingerprint }

enum AppEnvironmentTypeEnum { dev, uat, preProd, qa, staging, prod }

extension LoginTypeExtension on LoginTypeEnum {
  int get toInt {
    switch (this) {
      case LoginTypeEnum.sms:
        return 1;
      case LoginTypeEnum.whatsapp:
        return 4;
      case LoginTypeEnum.face:
        return 3;
      case LoginTypeEnum.fingerprint:
        return 2;
    }
  }

  String get displayName {
    switch (this) {
      case LoginTypeEnum.sms:
        return 'SMS';
      case LoginTypeEnum.whatsapp:
        return 'WhatsApp';
      case LoginTypeEnum.face:
        return 'Face Recognition';
      case LoginTypeEnum.fingerprint:
        return 'Fingerprint';
    }
  }

  static LoginTypeEnum? fromValue(int value) {
    switch (value) {
      case 1:
        return LoginTypeEnum.sms;
      case 2:
        return LoginTypeEnum.fingerprint;
      case 3:
        return LoginTypeEnum.face;
      case 4:
        return LoginTypeEnum.whatsapp;
      default:
        return null;
    }
  }
}

extension OTPTypeEnumExtension on OTPTypeEnum {
  /// Convert enum to int
  int toInt() {
    switch (this) {
      case OTPTypeEnum.sms:
        return 1;
      case OTPTypeEnum.whatsapp:
        return 2;
    }
  }

  /// Convert int to enum
  static OTPTypeEnum fromInt(int value) {
    switch (value) {
      case 1:
        return OTPTypeEnum.sms;
      case 2:
        return OTPTypeEnum.whatsapp;
      default:
        throw Exception("Invalid OTPTypeEnum value: $value");
    }
  }
}

enum ServiceTypeEnum {
  advancePayment, //3
  ancillaryOrder, //3
  appointmentPayment, //2
  covidPayment, //2
  erOnlineCheckIn, //3
  liveCareAppointment //4
}

extension ServiceTypeEnumExt on ServiceTypeEnum {
  String value() {
    switch (this) {
      case ServiceTypeEnum.advancePayment:
        return "Advance Payment";
      case ServiceTypeEnum.ancillaryOrder:
        return "Ancillary Order";
      case ServiceTypeEnum.appointmentPayment:
        return "Appointment Payment";
      case ServiceTypeEnum.covidPayment:
        return "Covid Payment";
      case ServiceTypeEnum.erOnlineCheckIn:
        return "ER Online Check In";
      case ServiceTypeEnum.liveCareAppointment:
        return "LiveCare Appointment";
    }
  }

  int getIdFromServiceEnum() {
    switch (this) {
      case ServiceTypeEnum.advancePayment:
        return 3;
      case ServiceTypeEnum.ancillaryOrder:
        return 3;
      case ServiceTypeEnum.appointmentPayment:
        return 2;
      case ServiceTypeEnum.covidPayment:
        return 2;
      case ServiceTypeEnum.erOnlineCheckIn:
        return 3;
      case ServiceTypeEnum.liveCareAppointment:
        return 4;
    }
  }
}

