40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
/*
|
|
File: PaymentManagementService.h
|
|
Description: Declares the PaymentManagementService class which manages payment operations in the Vehicle Service Management System.
|
|
Provides functionality to generate invoices, retrieve customer invoices, complete payments, send payment reminders,
|
|
and handle notifications using the Observer pattern.
|
|
Author: Trenser
|
|
Date: 19-May-2026
|
|
*/
|
|
|
|
#pragma once
|
|
#include <string>
|
|
#include "Map.h"
|
|
#include "NotificationManagementService.h"
|
|
#include "Enums.h"
|
|
#include "DataStore.h"
|
|
|
|
class ServiceBooking;
|
|
class Invoice;
|
|
|
|
class PaymentManagementService : public NotificationManagementService
|
|
{
|
|
private:
|
|
DataStore& m_dataStore;
|
|
static util::Map<std::string, User*> m_observers;
|
|
util::Vector<std::string> getObserverIDs() override;
|
|
public:
|
|
PaymentManagementService() : m_dataStore(DataStore::getInstance()) {}
|
|
void generateInvoice(ServiceBooking* booking);
|
|
util::Map<std::string, Invoice*> getInvoices(const std::string& customerID);
|
|
void completePayment(const std::string& invoiceID, util::PaymentMode paymentMode);
|
|
void sendPaymentReminders();
|
|
void sendNotification(User* user, const std::string& title, const std::string& message) override;
|
|
void attach(User* user) override;
|
|
void detach(User* user) override;
|
|
void loadInvoices();
|
|
void saveInvoices();
|
|
void loadObservers();
|
|
void saveObservers();
|
|
};
|