import 'package:pshared/models/payment/type.dart';


PaymentType paymentTypeFromValue(String value) {
  switch (value) {
    case 'iban':
      return PaymentType.iban;
    case 'card':
      return PaymentType.card;
    case 'cardToken':
      return PaymentType.cardToken;
    case 'bankAccount':
      return PaymentType.bankAccount;
    case 'ledger':
      return PaymentType.ledger;
    case 'wallet':
      return PaymentType.wallet;
    case 'managedWallet':
      return PaymentType.managedWallet;
    case 'cryptoAddress':
      return PaymentType.externalChain;
    default:
      return PaymentType.iban;
  }
}

String paymentTypeToValue(PaymentType type) {
  switch (type) {
    case PaymentType.iban:
      return 'iban';
    case PaymentType.card:
      return 'card';
    case PaymentType.cardToken:
      return 'cardToken';
    case PaymentType.ledger:
      return 'ledger';
    case PaymentType.bankAccount:
      return 'bankAccount';
    case PaymentType.wallet:
      return 'wallet';
    case PaymentType.managedWallet:
      return 'managedWallet';
    case PaymentType.externalChain:
      return 'cryptoAddress';
  }
}
