#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(QString name READ name WRITE setName)
    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);

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

private:
    friend class odb::access;
#pragma db id auto
    int m_id;
    QString m_name;
    int m_unitPrice;
    Enums::VatType m_vatType;
    QString m_pluginId;
    QString m_favButtonName;
};

typedef QSharedPointer<FavoritItem> FavoritItemPtr;

#endif // FAVORITITEM_H
