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.
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
#ifndef SREVICEITEM_H
|
|
#define SREVICEITEM_H
|
|
|
|
#include "camp-data.h"
|
|
#include <QObject>
|
|
#include <QSharedPointer>
|
|
#include <QWeakPointer>
|
|
#include <QDecDouble.hh>
|
|
|
|
#include <odb/core.hxx>
|
|
#include <accservice.h>
|
|
|
|
class CampData;
|
|
|
|
#pragma db object
|
|
class ServiceItem : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QString name READ name WRITE setName)
|
|
Q_PROPERTY(QString code READ code WRITE setCode)
|
|
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
|
|
Q_PROPERTY(bool salePossible READ salePossible WRITE setSalePossible)
|
|
Q_PROPERTY(AccService::ServiceType type READ type WRITE setType)
|
|
Q_ENUMS(AccService::ServiceType)
|
|
|
|
public:
|
|
explicit ServiceItem(QObject *parent = 0);
|
|
|
|
int id() const;
|
|
void setId(int id);
|
|
|
|
QString name() const;
|
|
void setName(const QString &name);
|
|
|
|
QString code() const;
|
|
void setCode(const QString &code);
|
|
|
|
QDecDouble price() const;
|
|
void setPrice(QDecDouble price);
|
|
|
|
bool salePossible() const;
|
|
void setSalePossible(bool salePossible);
|
|
|
|
AccService::ServiceType type() const;
|
|
void setType(const AccService::ServiceType &type);
|
|
|
|
QWeakPointer<CampData> campData() const;
|
|
void setCampData(const QWeakPointer<CampData> &campData);
|
|
|
|
private:
|
|
friend class odb::access;
|
|
#pragma db id auto
|
|
int m_id;
|
|
QString m_name;
|
|
QString m_code;
|
|
int m_price;
|
|
bool m_salePossible;
|
|
AccService::ServiceType m_type;
|
|
#pragma db not_null
|
|
QWeakPointer<CampData> m_campData;
|
|
};
|
|
|
|
#endif // SREVICEITEM_H
|