#ifndef COMMODITYDATA_H #define COMMODITYDATA_H #include #include #include #include "commoditytypedata.h" #include #include #include #include #pragma db object class CommodityData : public ShopItem { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QString shortName READ shortName WRITE setShortName) Q_PROPERTY(QString code READ code WRITE setCode) Q_PROPERTY(QSharedPointer type READ type WRITE setType) Q_PROPERTY(QDecDouble price READ price WRITE setPrice) Q_PROPERTY(Enums::VatType vat READ vat WRITE setVat) Q_PROPERTY(int count READ count WRITE setCount) public: CommodityData(QObject *parent = 0); int id() const; void setId(int id); QString name() const; void setName(const QString &name); QString shortName() const; void setShortName(const QString &shortName); QString code() const; void setCode(const QString &code); QSharedPointer type() const; void setType(const QSharedPointer &type); QDecDouble price() const; void setPrice(const QDecDouble &price); Enums::VatType vat() const; void setVat(const Enums::VatType &vat); int count() const; void setCount(int count); private: friend class odb::access; #pragma db id auto int m_id; QString m_name; QString m_shortName; QString m_code; QSharedPointer m_type; int m_price; Enums::VatType m_vat; int m_count; }; #endif // COMMODITYDATA_H