package com.bitso;

import java.math.BigDecimal;
import java.util.Date;

import org.json.JSONObject;
import com.bitso.helpers.Helpers;

public class BitsoTrade {
    public String book;
    public BigDecimal major;
    public Date tradeDate;
    public BigDecimal minor;
    public BigDecimal feesAmount;
    public String feesCurrency;
    public BigDecimal price;
    // TODO:
    // Check how long the tradeId would be, in order
    // to save it in an int or long type
    public int tid;
    public String oid;
    public String side;

    public BitsoTrade(JSONObject o){
        book =  Helpers.getString(o, "book");
        major = Helpers.getBD(o, "major");
        tradeDate =  Helpers.getZonedDatetime(o, "created_at");
        minor =  Helpers.getBD(o, "minor");
        feesAmount = Helpers.getBD(o, "fees_amount");
        feesCurrency = Helpers.getString(o, "fees_currency");
        price = Helpers.getBD(o, "price");
        tid = Helpers.getInteger(o, "tid");
        oid = Helpers.getString(o, "oid");
        side = Helpers.getString(o, "side");
    }
    
    @Override
    public String toString() {
        return Helpers.fieldPrinter(this);
    }
}

@@ -156,29 +156,32 @@
 rade %7B%0A    p
-ublic
+rotected
  String book
@@ -183,29 +183,32 @@
  book;%0A    p
-ublic
+rotected
  BigDecimal 
@@ -219,21 +219,24 @@
 r;%0A    p
-ublic
+rotected
  Date tr
@@ -245,29 +245,32 @@
 eDate;%0A    p
-ublic
+rotected
  BigDecimal 
@@ -277,29 +277,32 @@
 minor;%0A    p
-ublic
+rotected
  BigDecimal 
@@ -314,29 +314,32 @@
 mount;%0A    p
-ublic
+rotected
  String fees
@@ -353,21 +353,24 @@
 y;%0A    p
-ublic
+rotected
  BigDeci
@@ -492,21 +492,24 @@
 pe%0A    p
-ublic
+rotected
  int tid
@@ -507,37 +507,40 @@
 d int tid;%0A    p
-ublic
+rotected
  String oid;%0A   
@@ -537,29 +537,32 @@
 g oid;%0A    p
-ublic
+rotected
  String side
@@ -599,16 +599,17 @@
 bject o)
+ 
 %7B%0A      
@@ -616,17 +616,16 @@
   book =
- 
  Helpers
@@ -709,17 +709,16 @@
 deDate =
- 
  Helpers
@@ -768,17 +768,16 @@
  minor =
- 
  Helpers
@@ -1093,20 +1093,1458 @@
 ;%0A    %7D%0A
-    
+%0A    public String getBook() %7B%0A        return book;%0A    %7D%0A%0A    public void setBook(String book) %7B%0A        this.book = book;%0A    %7D%0A%0A    public BigDecimal getMajor() %7B%0A        return major;%0A    %7D%0A%0A    public void setMajor(BigDecimal major) %7B%0A        this.major = major;%0A    %7D%0A%0A    public Date getTradeDate() %7B%0A        return tradeDate;%0A    %7D%0A%0A    public void setTradeDate(Date tradeDate) %7B%0A        this.tradeDate = tradeDate;%0A    %7D%0A%0A    public BigDecimal getMinor() %7B%0A        return minor;%0A    %7D%0A%0A    public void setMinor(BigDecimal minor) %7B%0A        this.minor = minor;%0A    %7D%0A%0A    public BigDecimal getFeesAmount() %7B%0A        return feesAmount;%0A    %7D%0A%0A    public void setFeesAmount(BigDecimal feesAmount) %7B%0A        this.feesAmount = feesAmount;%0A    %7D%0A%0A    public String getFeesCurrency() %7B%0A        return feesCurrency;%0A    %7D%0A%0A    public void setFeesCurrency(String feesCurrency) %7B%0A        this.feesCurrency = feesCurrency;%0A    %7D%0A%0A    public BigDecimal getPrice() %7B%0A        return price;%0A    %7D%0A%0A    public void setPrice(BigDecimal price) %7B%0A        this.price = price;%0A    %7D%0A%0A    public int getTid() %7B%0A        return tid;%0A    %7D%0A%0A    public void setTid(int tid) %7B%0A        this.tid = tid;%0A    %7D%0A%0A    public String getOid() %7B%0A        return oid;%0A    %7D%0A%0A    public void setOid(String oid) %7B%0A        this.oid = oid;%0A    %7D%0A%0A    public String getSide() %7B%0A        return side;%0A    %7D%0A%0A    public void setSide(String side) %7B%0A        this.side = side;%0A    %7D%0A
 %0A    @Ov

Add getters and setters to BitsoTrade