restsmodel.h 565 B

1234567891011121314151617181920212223
  1. #ifndef RESTSMODEL_H
  2. #define RESTSMODEL_H
  3. #include "models/basemodel.h"
  4. class RestsModel : public BaseModel
  5. {
  6. public:
  7. explicit RestsModel(QObject *parent = nullptr);
  8. float productRest(const QString &storeId, const QString &productId);
  9. void submitRest(const QString &storeId, const QString &productId, float rest);
  10. private:
  11. QVariantMap findRest(const QString &storeId, const QString &productId);
  12. void loadCache();
  13. void clearCache();
  14. using Key = QPair<QString, QString>;
  15. QMap<Key, QVariantMap> m_rests;
  16. };
  17. #endif // RESTSMODEL_H