4b76cae358
<UserStory> 1955: Model Refactoring</UserStory> UserStory #1955 <Changes> 1. Replaced CSV-based serialization and deserialization in ComboPackage, JobCard, Service, and ServiceBooking models with fixed-size SerializedRecord structures for shared memory storage. 2. Implemented serialize() methods to convert objects into SerializedComboPackage, SerializedJobCard, SerializedService, and SerializedServiceBooking records. 3. Implemented deserialize() methods to reconstruct objects directly from SerializedRecord types instead of parsing CSV strings. 4. Updated model class interfaces to use SerializedRecord types, removing legacy CSV serialization APIs and header generation functions. 5. Added SerializedRecords.h dependencies and forward declarations for Serialized structures across affected models. </Changes> <Test> N/A </Test> <Review> Sreeja Reghukumar, please review </Review>
76 lines
2.4 KiB
C++
76 lines
2.4 KiB
C++
/*
|
|
File: JobCard.h
|
|
Description: Header file declaring the JobCard class, which represents
|
|
a service job card containing booking, service, technician,
|
|
and status details.
|
|
Author: Trenser
|
|
Date:19-May-2026
|
|
*/
|
|
|
|
#pragma once
|
|
#include <string>
|
|
#include "Enums.h"
|
|
#include "Timestamp.h"
|
|
|
|
class ServiceBooking;
|
|
class Service;
|
|
class User;
|
|
struct SerializedJobCard;
|
|
|
|
class JobCard
|
|
{
|
|
private:
|
|
static int m_uid;
|
|
std::string m_id;
|
|
std::string m_bookingId;
|
|
ServiceBooking* m_booking;
|
|
Service* m_service;
|
|
std::string m_serviceId;
|
|
std::string m_technicianId;
|
|
User* m_technician;
|
|
util::Timestamp m_assignedDate;
|
|
util::ServiceJobStatus m_status;
|
|
util::Timestamp m_completionDate;
|
|
public:
|
|
JobCard();
|
|
JobCard(const std::string& bookingId,
|
|
ServiceBooking* booking,
|
|
Service* service,
|
|
const std::string& serviceId,
|
|
const std::string& technicianId,
|
|
User* technician,
|
|
const util::Timestamp& assignedDate,
|
|
util::ServiceJobStatus status,
|
|
const util::Timestamp& completionDate
|
|
);
|
|
JobCard(const std::string& id,
|
|
const std::string& bookingId,
|
|
const std::string& serviceId,
|
|
const std::string& technicianId,
|
|
const util::Timestamp& assignedDate,
|
|
util::ServiceJobStatus status,
|
|
const util::Timestamp& completionDate
|
|
);
|
|
const std::string& getId() const;
|
|
const std::string& getBookingId() const;
|
|
ServiceBooking* getBooking() const;
|
|
Service* getService() const;
|
|
const std::string& getServiceId() const;
|
|
const std::string& getTechnicianId() const;
|
|
User* getTechnician() const;
|
|
const util::Timestamp& getAssignedDate() const;
|
|
util::ServiceJobStatus getStatus() const;
|
|
const util::Timestamp& getCompletionDate() const;
|
|
void setId(const std::string& id);
|
|
void setBookingId(const std::string& bookingId);
|
|
void setBooking(ServiceBooking* booking);
|
|
void setService(Service* service);
|
|
void setServiceId(const std::string& serviceId);
|
|
void setTechnicianId(const std::string& technicianId);
|
|
void setTechnician(User* technician);
|
|
void setAssignedDate(const util::Timestamp& assignedDate);
|
|
void setStatus(util::ServiceJobStatus status);
|
|
void setCompletionDate(const util::Timestamp& completionDate);
|
|
SerializedJobCard serialize() const;
|
|
static JobCard* deserialize(const SerializedJobCard&);
|
|
}; |