decode method

  1. @override
TransactionReason decode(
  1. dynamic value
)

Implementation

@override
TransactionReason decode(dynamic value) {
  switch (value) {
    case "RECEIVED":
      return TransactionReason.received;
    case "RETURNED":
      return TransactionReason.returned;
    case "LOST_IN_STORAGE":
      return TransactionReason.lostInStorage;
    case "LOST_IN_TRANSIT":
      return TransactionReason.lostInTransit;
    case "DAMAGED_IN_STORAGE":
      return TransactionReason.damagedInStorage;
    case "DAMAGED_IN_TRANSIT":
      return TransactionReason.damagedInTransit;
    default:
      throw MapperException.unknownEnumValue(value);
  }
}