41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
/*
|
|
File: InventoryManagementService.h
|
|
Description: Header file declaring the InventoryManagementService class,
|
|
which manages inventory items, stock updates, and notifications
|
|
related to low stock alerts. Inherits from NotificationManagementService.
|
|
Author: Trenser
|
|
Date:19-May-2026
|
|
*/
|
|
|
|
#pragma once
|
|
#include <string>
|
|
#include "Map.h"
|
|
#include "Vector.h"
|
|
#include "NotificationManagementService.h"
|
|
#include "DataStore.h"
|
|
|
|
class InventoryItem;
|
|
|
|
class InventoryManagementService : public NotificationManagementService
|
|
{
|
|
private:
|
|
DataStore& m_dataStore;
|
|
static util::Map<std::string, User*> m_observers;
|
|
util::Vector<std::string> getObserverIDs() override;
|
|
public:
|
|
InventoryManagementService() : m_dataStore(DataStore::getInstance()) {}
|
|
util::Map<std::string, InventoryItem*> getInventoryItems();
|
|
InventoryItem* getInventoryItem(const std::string& inventoryItemID);
|
|
void addInventoryItem(const std::string& partName, int quantity, double price);
|
|
void removeInventoryItem(const std::string& inventoryItemID);
|
|
void addInventoryItemStock(const std::string& selectedItemId, int quantity);
|
|
void sendLowStockAlerts();
|
|
void sendNotification(User* user, const std::string& title, const std::string& message) override;
|
|
void attach(User* user) override;
|
|
void detach(User* user) override;
|
|
void loadInventoryItems();
|
|
void saveInventoryItems();
|
|
void loadObservers();
|
|
void saveObservers();
|
|
};
|