#ifndef ENTERPRISEDAO_H
#define ENTERPRISEDAO_H

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

class EnterpriseDAO
{
public:
    struct Data {
        QString name;
        QString cif;
        QString address;
        QString postcode;
        QString city;
        QString province;
        QString country;
        QString phone;
        QString mobile;
        QString fax;
        QString email;
        QString web;
        QString cifCommunity;
        QString iae;
        QString cnae;
        QString dcnae;
        QByteArray logo1;
        QByteArray logo2;
        QString createdAt;
        QString createdBy;
    };

    static bool create(const Data& data);
    static bool read(const QString& name, Data& data);
    static bool update(const Data& data);
    static bool remove(const QString& name);
    static bool exists(const QString& name, const QString& cif);
    static QVector<QString> getAllNames();
};

#endif // ENTERPRISEDAO_H