#ifndef THIRDDAO_H
#define THIRDDAO_H

#include <QString>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include <QVector>
#include <QDate>

class ThirdDAO
{
public:
    struct Data {
        int id = 0;
        QString form;
        QString cif;
        QString name;
        QString nickname;
        QString family;
        QString intraFc;
        int state = 1;
        int clientState = 1;
        QString clientCode;
        QString clientAccount;
        int supplierState = 1;
        QString supplierCode;
        QString supplierAccount;
        QString address;
        QString postcode;
        QString city;
        QString province;
        QString countryId;
        QString phone;
        QString mobile;
        QString fax;
        QString email;
        QString website;
        QString paymentMethod;
        QString paymentType;
        QByteArray logo;
        QString notePublic;
        QString notePrivate;
        QDate updatedAt;
        QDate createdAt;
        QString createdBy;
    };

    static bool create(const Data& data);
    static bool read(int id, Data& data);
    static bool readByCif(const QString& cif, Data& data);
    static bool update(const Data& data);
    static bool remove(int id);
    static bool exists(int id);
    static QVector<int> getAllIds();
    static QVector<Data> getAll();
};

#endif // THIRDDAO_H