Rests model was added

This commit is contained in:
2023-04-13 17:57:27 +02:00
parent fc1d96437f
commit 5264238212
10 changed files with 91 additions and 52 deletions

23
models/restsmodel.h Normal file
View File

@@ -0,0 +1,23 @@
#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