class Discount implements Serializable {

    public static Discount fromJSON(JSONObject o)
        throws JSONException, ParseException {
        String id = o.getString("id");
        String label = o.getString("label");
        double rate = o.getDouble("rate");
        String startDate = o.getString("startDate");
        String endDate = o.getString("endDate");
        String barcode = o.getString("barcode");
        int barcodeType = o.getInt("barcodeType");
        return new Discount(id, label, rate, startDate, endDate, barcode, barcodeType);
    }

    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);

}