Files
joelthomastrenser 56c5c2dc70 Refactor notification service abstraction
- Removed observer map from Subject base class
- Removed notify() from Subject interface
- Made NotificationManagementService abstract with pure virtual methods
- Added static observer maps to notification service implementations
- Added attach() and detach() overrides in inventory, payment, and service management services
- Added update() override in User model for observer pattern support
- Updated notification method declarations with override specifiers
2026-05-19 19:39:55 +05:30

46 lines
1.4 KiB
C++

#pragma once
#include <string>
#include "Map.h"
#include "Observer.h"
#include "Enums.h"
class Notification;
class User : public Observer
{
private:
static int m_uid;
std::string m_id;
std::string m_userName;
std::string m_password;
std::string m_name;
std::string m_phone;
std::string m_email;
util::Map<std::string, Notification*> m_notifications;
util::UserType m_type;
util::State m_status;
public:
User();
User(const std::string& userName, const std::string& password, const std::string& name, const std::string& phone, const std::string& email, util::UserType role);
~User();
const std::string& getId() const;
const std::string& getUserName() const;
const std::string& getPassword() const;
const std::string& getName() const;
const std::string& getPhone() const;
const std::string& getEmail() const;
util::Map<std::string, Notification*>& getNotifications();
util::UserType getUserType() const;
util::State getState() const;
void setId(const std::string& id);
void setUserName(const std::string& userName);
void setPassword(const std::string& password);
void setName(const std::string& name);
void setPhone(const std::string& phone);
void setEmail(const std::string& email);
void addNotification(Notification* notification);
void setRole(util::UserType role);
void setState(util::State status);
void update(Notification* notification) override;
};