#ifndef HTTPUPDATENODEAPPROVAL_H
#define HTTPUPDATENODEAPPROVAL_H
#include <QThread>
#include <QtQml/qqml.h>

class HttpUpdateNodeApproval : public QThread
{
    Q_OBJECT
    QML_NAMED_ELEMENT(HttpUpdateNodeApproval)

    Q_PROPERTY(int nodeId READ nodeId WRITE setNodeId)
    Q_PROPERTY(QString formData READ formData WRITE setFormData)
    Q_PROPERTY(QString approvalStatus READ approvalStatus WRITE setApprovalStatus)
public:
    explicit HttpUpdateNodeApproval(QObject *parent = nullptr);

    int nodeId()
    {
        return this->m_nodeId;
    }
    void setNodeId(int nodeId)
    {
        m_nodeId = nodeId;
    }

    QString formData()
    {
        return this->m_formData;
    }
    void setFormData(const QString& formData)
    {
        m_formData = formData;
    }

    QString approvalStatus()
    {
        return this->m_approvalStatus;
    }
    void setApprovalStatus(const QString& approvalStatus)
    {
        m_approvalStatus = approvalStatus;
    }
protected:
    void run() override;
private:
    void httpRequestUpdateNodeApproval(void);
public slots:
    void slotHttpResponseUpdateNodeApproval(QByteArray data);
signals:
    void signalPostRequestData(quint64 id, QString postUrl, QByteArray data, QByteArray file, QString token);
    void signalUpdateNodeApprovalReturnStat(int stat, QString str);
private:
    int m_nodeId;
    QString m_formData;
    QString m_approvalStatus;
};
#endif // HTTPUPDATENODEAPPROVAL_H
