24 lines
565 B
C++
24 lines
565 B
C++
#ifndef RESTSMODEL_H
|
|
#define RESTSMODEL_H
|
|
|
|
#include "models/basemodel.h"
|
|
|
|
class RestsModel : public BaseModel
|
|
{
|
|
public:
|
|
explicit RestsModel(QObject *parent = nullptr);
|
|
|
|
float productRest(const QString &storeId, const QString &productId);
|
|
void submitRest(const QString &storeId, const QString &productId, float rest);
|
|
|
|
private:
|
|
QVariantMap findRest(const QString &storeId, const QString &productId);
|
|
void loadCache();
|
|
void clearCache();
|
|
|
|
using Key = QPair<QString, QString>;
|
|
QMap<Key, QVariantMap> m_rests;
|
|
};
|
|
|
|
#endif // RESTSMODEL_H
|