import 'package:intl/intl.dart';

import '../../domain/auth/auth.dart';

part 'date_extension.dart';

extension StringExt on String {
  CheckPhoneStatus toCheckPhoneStatus() {
    switch (this) {
      case 'NOT_REGISTERED':
        return CheckPhoneStatus.notRegistered;
      case 'PASSWORD_REQUIRED':
        return CheckPhoneStatus.passwordRequired;
      default:
        return CheckPhoneStatus.unknown;
    }
  }

  ResendStatus toResendStatus() {
    switch (this) {
      case 'RESEND_NOT_ALLOWED':
        return ResendStatus.resendNotAllowed;
      case 'SUCCESS':
        return ResendStatus.success;
      default:
        return ResendStatus.unknown;
    }
  }
}
