#ifndef DISHESOBJECT_H
#define DISHESOBJECT_H
#include <QObject>
#include <QJsonObject>
#include <QVariant>
#include <QMetaProperty>
class dishesObject : public QObject
{
    Q_OBJECT
    Q_PROPERTY (QString id READ getId WRITE setId)
    Q_PROPERTY (QString specId READ getspecId WRITE setspecId)
    Q_PROPERTY (QString name READ getname WRITE setname)
    Q_PROPERTY (QString specName READ getspecName WRITE setspecName)
    Q_PROPERTY (QString code READ getcode WRITE setcode)
    Q_PROPERTY (int packagePrice READ getpackagePrice WRITE setpackagePrice)
    Q_PROPERTY (int qty READ getqty WRITE setqty)
    Q_PROPERTY (int price READ getprice WRITE setprice)
    Q_PROPERTY (QString options READ getoptions WRITE setoptions)

    Q_PROPERTY (QString promotionSku READ getpromotionSku WRITE setpromotionSku)
    Q_PROPERTY (QString promotionName READ getpromotionName WRITE setpromotionName)
    Q_PROPERTY (int promotionQty READ getpromotionQty WRITE setpromotionQty)
    Q_PROPERTY (int promotionPrice READ getpromotionPrice WRITE setpromotionPrice)

public:
    explicit dishesObject(QObject *parent = 0):QObject(parent){}
    dishesObject(const dishesObject& dish,QObject* parent=0);
    dishesObject& operator =(const dishesObject& dish);
    void FetchDataFromJson(const QJsonObject &json);
    QString id;
    QString name;
    QString specId;
    QString specName;
    QString code;
    int qty;
    int packagePrice;
    int price;
    QString options;

    QString promotionSku;
    QString promotionName;
    int promotionQty;
    int promotionPrice;

    QList<dishesObject*> sub_products;

protected:
    inline QString getId(){ return id; }
    inline void setId(const QString& v){ id = v; }

    inline QString getspecId(){ return specId; }
    inline void setspecId(const QString& v){ specId = v; }

    inline QString getname(){ return name; }
    inline void setname(const QString& v){ name = v; }

    inline int getprice(){ return price; }
    inline void setprice(const int& v){ price = v; }

    inline QString getoptions(){ return options; }
    inline void setoptions(const QString& v){ options = v; }

    inline int getpackagePrice(){ return packagePrice; }
    inline void setpackagePrice(const int& v){ packagePrice = v; }

    inline QString getspecName(){ return specName; }
    inline void setspecName(const QString& v){ specName = v; }

    inline QString getcode(){ return code; }
    inline void setcode(const QString& v){ code = v; }

    inline int getqty(){ return qty; }
    inline void setqty(const int& v){ qty = v; }


    inline QString getpromotionSku(){ return promotionSku; }
    inline void setpromotionSku(const QString& v){ promotionSku = v; }

    inline QString getpromotionName(){ return promotionName; }
    inline void setpromotionName(const QString& v){ promotionName = v; }

    inline int getpromotionPrice(){ return promotionPrice; }
    inline void setpromotionPrice(const int& v){ promotionPrice = v; }

    inline int getpromotionQty(){ return promotionQty; }
    inline void setpromotionQty(const int& v){ promotionQty = v; }
};

#endif // DISHESOBJECT_H
