class ReceiptMappingOkHttp {

  public Receipt createReceiptFromDto(Object receiptDto) {
    ReceiptType type = ReceiptType.rawValueOf(jsonHelper.getInteger(receiptDto, "type"));
    switch (type) {
      case HARVEST_FEE:
      case LOCK_HASH_CREATED:
      case LOCK_HASH_COMPLETED:
      case LOCK_HASH_EXPIRED:
      case LOCK_SECRET_CREATED:
      case LOCK_SECRET_COMPLETED:
      case LOCK_SECRET_EXPIRED:
        return createBalanceChangeReceipt(
            jsonHelper.convert(receiptDto, BalanceChangeReceiptDTO.class));
      case MOSAIC_RENTAL_FEE:
      case NAMESPACE_RENTAL_FEE:
        return createBalanceTransferRecipient(
            jsonHelper.convert(receiptDto, BalanceTransferReceiptDTO.class));
      case MOSAIC_EXPIRED:
        return createArtifactExpiryReceipt(
            jsonHelper.convert(receiptDto, MosaicExpiryReceiptDTO.class), type);
      case NAMESPACE_EXPIRED:
      case NAMESPACE_DELETED:
        return createArtifactExpiryReceipt(
            jsonHelper.convert(receiptDto, NamespaceExpiryReceiptDTO.class), type);
      case INFLATION:
        return createInflationReceipt(jsonHelper.convert(receiptDto, InflationReceiptDTO.class));
      default:
        throw new IllegalArgumentException("Receipt type: " + type.name() + " not valid");
    }
  }

  public  ReceiptMappingOkHttp(JsonHelper jsonHelper);

}