#ifndef HBLASTREGRECORD_H
#define HBLASTREGRECORD_H

#include <QDateTime>
#include <QJsonDocument>
#include <QJsonObject>
#include <QString>
#include <QUuid>

#include "../blastRecordDet/hblastrecorddet.h"

class HBlastEquipmentRecord : public QObject {
    Q_OBJECT
    // 定义属性
    Q_PROPERTY(qint64 id READ getId WRITE setId)
    Q_PROPERTY(QString uuid READ getUuid WRITE setUuid)
    Q_PROPERTY(QString equipSn READ getEquipSn WRITE setEquipSn)
    Q_PROPERTY(QString equipVersion READ getEquipVersion WRITE setEquipVersion)
    Q_PROPERTY(int regDetoCount READ getRegDetoCount WRITE setRegDetoCount)
    Q_PROPERTY(int errorDetoCount READ getErrorDetoCount WRITE setErrorDetoCount)
    Q_PROPERTY(QString afterTestBusV READ getAfterTestBusV WRITE setAfterTestBusV)
    Q_PROPERTY(QString afterTestBusI READ getAfterTestBusI WRITE setAfterTestBusI)
    Q_PROPERTY(QString busLeakageCurrentI READ getBusLeakageCurrentI WRITE setBusLeakageCurrentI)
    Q_PROPERTY(QString netChargedV READ getNetChargedV WRITE setNetChargedV)
    Q_PROPERTY(QString netChargedI READ getNetChargedI WRITE setNetChargedI)
    Q_PROPERTY(QString beforeBlastingV READ getBeforeBlastingV WRITE setBeforeBlastingV)
    Q_PROPERTY(QString beforeBlastingI READ getBeforeBlastingI WRITE setBeforeBlastingI)
    Q_PROPERTY(QString recordUuid READ getRecordUUID WRITE setRecordUuid)
    Q_PROPERTY(QDateTime createdAt READ getCreatedAt WRITE setCreatedAt)
    Q_PROPERTY(QDateTime updatedAt READ getUpdatedAt WRITE setUpdatedAt)
    Q_PROPERTY(QDateTime deletedAt READ getDeletedAt WRITE setDeletedAt)
    Q_PROPERTY(qint64 createBy READ getCreateBy WRITE setCreateBy)
    Q_PROPERTY(qint64 updateBy READ getUpdateBy WRITE setUpdateBy)
   public:
    explicit HBlastEquipmentRecord(QObject *parent = nullptr);

    // Getter and Setter methods
    qint64 getId() const;
    void setId(qint64 newId);

    QString getUuid() const;
    void setUuid(const QString &newUuid);

    QString getEquipSn() const;
    void setEquipSn(const QString &newEquipSn);

    QString getEquipVersion() const;
    void setEquipVersion(const QString &newEquipVersion);

    int getRegDetoCount() const;
    void setRegDetoCount(int newRegDetoCount);

    int getErrorDetoCount() const;
    void setErrorDetoCount(int newErrorDetoCount);

    QString getAfterTestBusV() const;
    void setAfterTestBusV(const QString &newAfterTestBusV);

    QString getAfterTestBusI() const;
    void setAfterTestBusI(const QString &newAfterTestBusI);

    QString getBusLeakageCurrentI() const;
    void setBusLeakageCurrentI(const QString &newBusLeakageCurrentI);

    QString getNetChargedV() const;
    void setNetChargedV(const QString &newNetChargedV);

    QString getNetChargedI() const;
    void setNetChargedI(const QString &newNetChargedI);

    QString getBeforeBlastingV() const;
    void setBeforeBlastingV(const QString &newBeforeBlastingV);

    QString getBeforeBlastingI() const;
    void setBeforeBlastingI(const QString &newBeforeBlastingI);

    QString getRecordUUID() const;
    void setRecordUuid(const QString &newRecordUuid);

    QDateTime getCreatedAt() const;
    void setCreatedAt(const QDateTime &newCreatedAt);

    QDateTime getUpdatedAt() const;
    void setUpdatedAt(const QDateTime &newUpdatedAt);

    QDateTime getDeletedAt() const;
    void setDeletedAt(const QDateTime &newDeletedAt);

    qint64 getCreateBy() const;
    void setCreateBy(qint64 newCreateBy);

    qint64 getUpdateBy() const;
    void setUpdateBy(qint64 newUpdateBy);

    QList<HBlastRecordDet *> getDetRecords() const;
    void setDetRecords(QList<HBlastRecordDet *> detRecords);

    QJsonObject ToJson();

   private:
    qint64 id;
    QString uuid;
    QString equipSn;
    QString equipVersion;
    int regDetoCount;
    int errorDetoCount;
    QString afterTestBusV;
    QString afterTestBusI;
    QString busLeakageCurrentI;
    QString netChargedV;
    QString netChargedI;
    QString beforeBlastingV;
    QString beforeBlastingI;
    QString recordUuid;
    QDateTime createdAt;
    QDateTime updatedAt;
    QDateTime deletedAt;
    qint64 createBy;
    qint64 updateBy;
    QList<HBlastRecordDet *> detRecords;
};

#endif  // HBLASTREGRECORD_H
