tablette/src/model/model.hpp
2025-08-25 12:44:01 +02:00

47 lines
1.8 KiB
C++

#ifndef MODEL_HPP
#define MODEL_HPP
#include <string>
#include <vector>
#include "stock.hpp"
#include "itemType.hpp"
class Model
{
public:
Model();
~Model();
void addData(const std::string &data);
void createStock(const std::string &name, int capacity, const std::string &comment = "");
std::vector<Stock> getStocks() const;
// Méthodes pour gérer les ItemType
void createItemType(const std::string &name, const std::string &comment = "", int size = 1);
void createItemType(const std::string &name, int id, const std::string &comment = "", int size = 1);
std::vector<ItemType> getItemTypes() const;
ItemType* findItemTypeByName(const std::string &name);
// Méthodes pour ajouter des items aux stocks
bool addItemToStock(const std::string &stockName, const std::string &itemTypeName, int quantity);
Stock* findStockByName(const std::string &name);
// Nouvelles méthodes pour la gestion avancée
bool removeItemFromStock(const std::string &stockName, const std::string &itemTypeName, int quantity);
bool moveItemBetweenStocks(const std::string &sourceStock, const std::string &targetStock, const std::string &itemTypeName, int quantity);
bool deleteStock(const std::string &stockName);
bool deleteItemType(const std::string &typeName);
std::string getStockContentDetails(const std::string &stockName);
std::string getCapacitiesReport();
std::string getStatisticsReport();
private:
std::vector<Stock> stocks; // Assuming Stock is a class defined elsewhere
std::vector<ItemType> itemTypes; // Assuming ItemType is a class defined elsewhere
int nextStockId = 0; // To generate unique IDs for stocks
int nextItemTypeId = 0; // To generate unique IDs for item types
};
#endif // MODEL_HPP