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


extension LedgerAccountTypeDTOMapper on LedgerAccountTypeDTO {
  LedgerAccountType toDomain() {
    switch (this) {
      case LedgerAccountTypeDTO.unspecified:
        return LedgerAccountType.unspecified;
      case LedgerAccountTypeDTO.asset:
        return LedgerAccountType.asset;
      case LedgerAccountTypeDTO.liability:
        return LedgerAccountType.liability;
      case LedgerAccountTypeDTO.revenue:
        return LedgerAccountType.revenue;
      case LedgerAccountTypeDTO.expense:
        return LedgerAccountType.expense;
    }
  }
}

extension LedgerAccountTypeModelMapper on LedgerAccountType {
  LedgerAccountTypeDTO toDTO() {
    switch (this) {
      case LedgerAccountType.unspecified:
        return LedgerAccountTypeDTO.unspecified;
      case LedgerAccountType.asset:
        return LedgerAccountTypeDTO.asset;
      case LedgerAccountType.liability:
        return LedgerAccountTypeDTO.liability;
      case LedgerAccountType.revenue:
        return LedgerAccountTypeDTO.revenue;
      case LedgerAccountType.expense:
        return LedgerAccountTypeDTO.expense;
    }
  }
}
