67ac7f6625
<UserStory> 1954: Implement Service Refactoring </UserStory> UserStory #1954 <Changes> 1. Refactored notification handling to persist notifications directly in the datastore instead of maintaining notification collections within User objects. 2. Removed recipient User pointer dependencies from Notification and retained recipient user identification through recipientUserId. 3. Implemented generic observer persistence support in DataStore with shared helper methods for loading and saving observer subscriptions. 4. Added datastore-backed observer management for ServiceManagementService, PaymentManagementService, and InventoryManagementService. 5. Updated attach() and detach() operations to load, modify, and persist observer subscriptions using shared memory mappings. 6. Refactored sendNotification() implementations to create and persist Notification records directly to the datastore for subscribed observers. 7. Updated UserManagementService notification retrieval and deletion logic to operate on datastore notification records filtered by recipient user ID. 8. Removed notification ownership and observer-specific notification APIs from User and Observer classes. 9. Added configurable shared memory growth factor support and updated mapping expansion logic to use centralized configuration values. 10. Removed obsolete NotificationManagementService implementation and updated project configuration references. 11. Added DataStoreLockGuard integration for observer and notification persistence operations to ensure synchronized datastore access. </Changes> <Test> N/A </Test> <Review> Sreeja Reghukumar, please review </Review>
47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
/*
|
|
File: Config.h
|
|
Description: Header file declaring configuration constants for the Vehicle Service System.
|
|
Includes default admin account details such as username, name, password,
|
|
email, and phone number.
|
|
Author: Trenser
|
|
Date: 21-May-2026
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
namespace config
|
|
{
|
|
namespace admin
|
|
{
|
|
constexpr const char* DEFAULT_ADMIN_USERNAME = "admin";
|
|
constexpr const char* DEFAULT_ADMIN_NAME = "admin";
|
|
constexpr const char* DEFAULT_ADMIN_PASSWORD = "admin";
|
|
constexpr const char* DEFAULT_ADMIN_EMAIL = "admin@vss";
|
|
constexpr const char* DEFAULT_ADMIN_PHONE = "0000000000";
|
|
}
|
|
|
|
namespace threshold
|
|
{
|
|
constexpr int INVENTORY_LOW_STOCK_THRESHOLD = 5;
|
|
constexpr int PAYMENT_REMINDER_THRESHOLD_HOURS = 168;
|
|
}
|
|
|
|
namespace file
|
|
{
|
|
const size_t INITIAL_CAPACITY = 100;
|
|
const size_t GROWTH_FACTOR = 2;
|
|
constexpr const char* DIRECTORY = "files/";
|
|
constexpr const char* INVENTORYITEM_FILE = "files/InventoryItem.dat";
|
|
constexpr const char* USER_FILE = "files/User.dat";
|
|
constexpr const char* NOTIFICATION_FILE = "files/Notification.dat";
|
|
constexpr const char* SERVICE_FILE = "files/Service.dat";
|
|
constexpr const char* COMBOPACKAGE_FILE = "files/ComboPackage.dat";
|
|
constexpr const char* SERVICEBOOKING_FILE = "files/ServiceBooking.dat";
|
|
constexpr const char* JOBCARD_FILE = "files/JobCard.dat";
|
|
constexpr const char* INVOICE_FILE = "files/Invoice.dat";
|
|
constexpr const char* SERVICEMANAGEMENTOBSERVERS = "files/ServiceManagementObservers.dat";
|
|
constexpr const char* PAYMENTMANAGEMENTOBSERVERS = "files/PaymentManagementObservers.dat";
|
|
constexpr const char* INVENTORYMANAGEMENTOBSERVERS = "files/InventoryManagementObservers.dat";
|
|
}
|
|
}
|