class Discount implements Serializable {

    public JSONObject toJSON() throws JSONException, ParseException {
        JSONObject o = new JSONObject();
        o.put("id", this.id);
        o.put("label", this.label);
        o.put("rate", this.rate);
        o.put("startDate", convertDateToString(this.startDate));
        o.put("endDate", convertDateToString(this.endDate));
        o.put("barcode", this.barcode.getCode());
        o.put("barcodeType", this.barcode.getType());
        return o;
    }

    public  Discount(String id, String label, double rate, String start, String end, String barcode, int barcodeType);
    public  Discount(String id, double rate, String start, String end, String barcode, int barcodeType);

}