Setup codebase

This commit is contained in:
Joel Thomas
2026-05-19 09:56:36 +05:30
parent f39f9d0e79
commit a7ad188801
59 changed files with 3840 additions and 0 deletions
@@ -0,0 +1,3 @@
#include "AuthenticationManagementService.h"
User* AuthenticationManagementService::m_authenticatedUser = nullptr;
@@ -0,0 +1,18 @@
#pragma once
#include <string>
#include "DataStore.h"
class User;
class AuthenticationManagementService
{
private:
static User* m_authenticatedUser;
DataStore& m_dataStore;
public:
AuthenticationManagementService() : m_dataStore(DataStore::getInstance()) {}
bool login(const std::string& username, const std::string& password);
void logout();
void changePassword(const std::string& newPassword);
User* getAuthenticatedUser();
};
@@ -0,0 +1 @@
#include "InventoryManagementService.h"
@@ -0,0 +1,21 @@
#pragma once
#include <string>
#include "Map.h"
#include "NotificationManagementService.h"
#include "DataStore.h"
class InventoryItem;
class InventoryManagementService : public NotificationManagementService
{
private:
DataStore& m_dataStore;
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 sendLowStockAlerts();
void sendNotification(User* user, const std::string& title, const std::string& message);
};
@@ -0,0 +1 @@
#include "NotificationManagementService.h"
@@ -0,0 +1,12 @@
#pragma once
#include <string>
#include "Subject.h"
#include "User.h"
class NotificationManagementService : public Subject
{
public:
virtual void sendNotification(User* recipient, const std::string& title, const std::string& message) = 0;
virtual void attach(User* user) = 0;
virtual void detach(User* user) = 0;
};
@@ -0,0 +1 @@
#include "PaymentManagementService.h"
@@ -0,0 +1,22 @@
#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;
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);
};
@@ -0,0 +1 @@
#include "ServiceManagementService.h"
@@ -0,0 +1,34 @@
#pragma once
#include <string>
#include "Map.h"
#include "NotificationManagementService.h"
#include "DataStore.h"
class Service;
class ComboPackage;
class ServiceBooking;
class JobCard;
class ServiceManagementService : public NotificationManagementService
{
private:
DataStore& m_dataStore;
public:
ServiceManagementService() : m_dataStore(DataStore::getInstance()) {}
util::Map<std::string, Service*> getServices();
util::Map<std::string, ComboPackage*> getComboPackages();
void purchaseService(const util::Vector<std::string>& serviceIDs, const std::string& vehicleNumber, const std::string& vehicleBrand, const std::string& vehicleModel);
void purchaseComboPackage(const std::string& comboPackageID, const std::string& vehicleNumber, const std::string& vehicleBrand, const std::string& vehicleModel);
util::Map<std::string, ServiceBooking*> getServiceBookings();
util::Map<std::string, ServiceBooking*> getServiceBookings(const std::string& customerID);
void createJobCard(const std::string& bookingID, const std::string& technicianID, const std::string& serviceID);
void createService(const std::string& name, const util::Vector<std::string>& inventoryItemIDs, double laborCost);
void removeService(const std::string& serviceID);
util::Map<std::string, JobCard*> getJobCards(const std::string& technicianID);
void completeJob(const std::string& jobID);
void cancelCustomerServiceBookings(const std::string& customerID);
void cancelTechnicianJobs(const std::string& technicianID);
void createComboPackage(const std::string& name, const util::Vector<std::string>& serviceIDs, double discountPercentage);
void removeComboPackage(const std::string& comboPackageID);
void sendNotification(User* user, const std::string& title, const std::string& message);
};
@@ -0,0 +1 @@
#include "UserManagementService.h"
@@ -0,0 +1,24 @@
#pragma once
#include <string>
#include "Map.h"
#include "Enums.h"
#include "DataStore.h"
class User;
class Notification;
class UserManagementService
{
private:
DataStore& m_dataStore;
public:
UserManagementService() : m_dataStore(DataStore::getInstance()) {}
void createUser(const std::string& username, const std::string& password, const std::string& email, const std::string& phone, util::UserType type);
void updateUserDetails(const std::string& userID, const std::string& email, const std::string& phone);
util::Map<std::string, User*> getUsers();
util::Map<std::string, User*> getUsers(util::UserType type);
User* getUser(const std::string& userID);
void removeUser(const std::string& userID);
util::Vector<Notification*> getUserNotifications(const std::string& userID);
void deleteNotification(const std::string& notificationID, const std::string& userID);
};