import 'package:pshared/data/dto/ledger/role.dart';
import 'package:pshared/models/ledger/role.dart';


extension LedgerAccountRoleDTOMapper on LedgerAccountRoleDTO {
  LedgerAccountRole toDomain() {
    switch (this) {
      case LedgerAccountRoleDTO.unspecified:
        return LedgerAccountRole.unspecified;
      case LedgerAccountRoleDTO.operating:
        return LedgerAccountRole.operating;
      case LedgerAccountRoleDTO.hold:
        return LedgerAccountRole.hold;
      case LedgerAccountRoleDTO.transit:
        return LedgerAccountRole.transit;
      case LedgerAccountRoleDTO.settlement:
        return LedgerAccountRole.settlement;
      case LedgerAccountRoleDTO.clearing:
        return LedgerAccountRole.clearing;
      case LedgerAccountRoleDTO.pending:
        return LedgerAccountRole.pending;
      case LedgerAccountRoleDTO.reserve:
        return LedgerAccountRole.reserve;
      case LedgerAccountRoleDTO.liquidity:
        return LedgerAccountRole.liquidity;
      case LedgerAccountRoleDTO.fee:
        return LedgerAccountRole.fee;
      case LedgerAccountRoleDTO.chargeback:
        return LedgerAccountRole.chargeback;
      case LedgerAccountRoleDTO.adjustment:
        return LedgerAccountRole.adjustment;
    }
  }
}

extension LedgerAccountRoleModelMapper on LedgerAccountRole {
  LedgerAccountRoleDTO toDTO() {
    switch (this) {
      case LedgerAccountRole.unspecified:
        return LedgerAccountRoleDTO.unspecified;
      case LedgerAccountRole.operating:
        return LedgerAccountRoleDTO.operating;
      case LedgerAccountRole.hold:
        return LedgerAccountRoleDTO.hold;
      case LedgerAccountRole.transit:
        return LedgerAccountRoleDTO.transit;
      case LedgerAccountRole.settlement:
        return LedgerAccountRoleDTO.settlement;
      case LedgerAccountRole.clearing:
        return LedgerAccountRoleDTO.clearing;
      case LedgerAccountRole.pending:
        return LedgerAccountRoleDTO.pending;
      case LedgerAccountRole.reserve:
        return LedgerAccountRoleDTO.reserve;
      case LedgerAccountRole.liquidity:
        return LedgerAccountRoleDTO.liquidity;
      case LedgerAccountRole.fee:
        return LedgerAccountRoleDTO.fee;
      case LedgerAccountRole.chargeback:
        return LedgerAccountRoleDTO.chargeback;
      case LedgerAccountRole.adjustment:
        return LedgerAccountRoleDTO.adjustment;
    }
  }
}
