#pragma once

#include "db/ApplicationInfo.h"

class ApplicationDAO {
public:
    [[nodiscard]] static bool upsertApplication(const ApplicationInfo &info);

    [[nodiscard]] static bool updatePinCode(const QString &appId, const QString &pinCode);

    [[nodiscard]] static bool update(
        const int &appId,
        const QString &pinCode,
        const QString &comment,
        const QString &status
    );

    [[nodiscard]] static bool updatePinCodeStatus(
        const int &appId,
        const QString &pinCodeStatus,
        const QString &comment
    );

    [[nodiscard]] static ApplicationInfo getApplication(const QString &deviceId, const QString &appCode);

    [[nodiscard]] static QList<ApplicationInfo> getApplicationsByDeviceId(const QString &deviceId);

    [[nodiscard]] static bool checkInstalledApps(const QString &deviceId, const QSet<QString> &apps);
};
