45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
/*
|
|
File: Notification.h
|
|
Description: Declares the Notification class which represents system messages sent to users in the Vehicle Service Management System.
|
|
Each notification includes a unique ID, recipient details, title, message content, and timestamp of creation.
|
|
Author: Trenser
|
|
Date: 19-May-2026
|
|
*/
|
|
|
|
#pragma once
|
|
#include <string>
|
|
#include "Timestamp.h"
|
|
|
|
class User;
|
|
|
|
class Notification
|
|
{
|
|
private:
|
|
static int m_uid;
|
|
std::string m_id;
|
|
std::string m_recipientUserId;
|
|
User* m_recipient;
|
|
std::string m_title;
|
|
std::string m_message;
|
|
util::Timestamp m_createdAt;
|
|
public:
|
|
Notification();
|
|
Notification(const std::string& recipientUserId, User* recipient, const std::string& title, const std::string& message, const util::Timestamp& createdAt);
|
|
Notification(const std::string& id, const std::string& recipientUserId, const std::string& title, const std::string& message, const util::Timestamp& createdAt);
|
|
const std::string& getId() const;
|
|
const std::string& getRecipientUserId() const;
|
|
User* getRecipient() const;
|
|
const std::string& getTitle() const;
|
|
const std::string& getMessage() const;
|
|
const util::Timestamp& getCreatedAt() const;
|
|
void setId(const std::string& id);
|
|
void setRecipientUserId(const std::string& recipientUserId);
|
|
void setRecipient(User* recipient);
|
|
void setTitle(const std::string& title);
|
|
void setMessage(const std::string& message);
|
|
void setCreatedAt(const util::Timestamp& createdAt);
|
|
std::string serialize() const;
|
|
static Notification* deserialize(const std::string&);
|
|
static std::string getHeaders();
|
|
};
|