#ifndef POSTDATA_H
#define POSTDATA_H

#include <QString>
#include <QObject>
#include <odb/core.hxx>

#include <QtCore/qglobal.h>

#if defined(POSTREGISTER_LIBRARY)
#  define POSTREGISTERSHARED_EXPORT Q_DECL_EXPORT
#else
#  define POSTREGISTERSHARED_EXPORT Q_DECL_IMPORT
#endif

#pragma db object
class POSTREGISTERSHARED_EXPORT PostData : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString townPart READ townPart WRITE setTownPart)
    Q_PROPERTY(QString zipCode READ zipCode WRITE setZipCode)
    Q_PROPERTY(QString postName READ postName WRITE setPostName)
    Q_PROPERTY(QString code READ code WRITE setCode)
    Q_PROPERTY(QString township READ township WRITE setTownship)
    Q_PROPERTY(QString town READ town WRITE setTown)

public:
    Q_INVOKABLE explicit PostData(QObject *parent = NULL);

    QString townPart() const;
    void setTownPart(const QString &townPart);

    int id() const;
    void setId(int id);

    QString zipCode() const;
    void setZipCode(const QString &zipCode);

    QString postName() const;
    void setPostName(const QString &postName);

    QString code() const;
    void setCode(const QString &code);

    QString township() const;
    void setTownship(const QString &township);

    QString town() const;
    void setTown(const QString &town);

private:
    friend class odb::access;
#pragma db id auto
    int m_id;
    QString m_townPart;
    QString m_zipCode;
    QString m_postName;
    QString m_code;
    QString m_township;
    QString m_town;
};

#endif // POSTDATA_H
