You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.8 KiB
C++

#ifndef FAVORITITEM_H
#define FAVORITITEM_H
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QDecDouble.hh>
#include <enums.h>
#include <ishopitem.h>
#include <odb/core.hxx>
class IShopItem;
#pragma db object
class FavoritItem : public QObject, public IShopItem
{
Q_OBJECT
Q_PROPERTY(int id READ id WRITE setId)
Q_PROPERTY(int refId READ refId WRITE setRefId)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString shortName READ shortName WRITE setShortName)
Q_PROPERTY(QDecDouble unitPrice READ unitPrice WRITE setUnitPrice)
Q_PROPERTY(Enums::VatType vatType READ vatType WRITE setVatType)
Q_PROPERTY(QString pluginId READ pluginId WRITE setPluginId)
Q_PROPERTY(QString favButtonName READ favButtonName WRITE setFavButtonName)
public:
FavoritItem();
// IShopItem interface
public:
int id() override;
void setId(int id);
QString name() override;
void setName(const QString &name);
virtual QString shortName() override;
void setShortName(const QString &shortName);
QDecDouble unitPrice() override;
void setUnitPrice(QDecDouble unitPrice);
Enums::VatType vatType() override;
void setVatType(const Enums::VatType &vatType);
QString pluginId() override;
void setPluginId(const QString &pluginId);
QString favButtonName() const;
void setFavButtonName(const QString &favButtonName);
int refId() const;
void setRefId(int refId);
private:
friend class odb::access;
#pragma db id auto
int m_id;
int m_refId;
QString m_name;
int m_unitPrice;
Enums::VatType m_vatType;
QString m_pluginId;
QString m_favButtonName;
QString m_shortName;
};
typedef QSharedPointer<FavoritItem> FavoritItemPtr;
#endif // FAVORITITEM_H