131 lines
2.4 KiB
C++
131 lines
2.4 KiB
C++
#include "JobCard.h"
|
|
|
|
int JobCard::m_uid = 0;
|
|
|
|
JobCard::JobCard()
|
|
: m_id("JC" + std::to_string(++m_uid)),
|
|
m_booking(nullptr),
|
|
m_service(nullptr),
|
|
m_technician(nullptr),
|
|
m_status(ServiceJobStatus()) {}
|
|
|
|
JobCard::JobCard(const std::string& bookingId,
|
|
ServiceBooking* booking,
|
|
Service* service,
|
|
const std::string& serviceId,
|
|
const std::string& technicianId,
|
|
User* technician,
|
|
const util::Timestamp& assignedDate,
|
|
ServiceJobStatus status,
|
|
const util::Timestamp& completionDate
|
|
)
|
|
: m_id("JC" + std::to_string(++m_uid)),
|
|
m_bookingId(bookingId),
|
|
m_booking(booking),
|
|
m_service(service),
|
|
m_serviceId(serviceId),
|
|
m_technicianId(technicianId),
|
|
m_technician(technician),
|
|
m_assignedDate(assignedDate),
|
|
m_status(status),
|
|
m_completionDate(completionDate) {}
|
|
|
|
const std::string& JobCard::getId() const
|
|
{
|
|
return m_id;
|
|
}
|
|
|
|
const std::string& JobCard::getBookingId() const
|
|
{
|
|
return m_bookingId;
|
|
}
|
|
|
|
ServiceBooking* JobCard::getBooking() const
|
|
{
|
|
return m_booking;
|
|
}
|
|
|
|
Service* JobCard::getService() const
|
|
{
|
|
return m_service;
|
|
}
|
|
|
|
const std::string& JobCard::getServiceId() const
|
|
{
|
|
return m_serviceId;
|
|
}
|
|
|
|
const std::string& JobCard::getTechnicianId() const
|
|
{
|
|
return m_technicianId;
|
|
}
|
|
|
|
User* JobCard::getTechnician() const
|
|
{
|
|
return m_technician;
|
|
}
|
|
|
|
const util::Timestamp& JobCard::getAssignedDate() const
|
|
{
|
|
return m_assignedDate;
|
|
}
|
|
|
|
ServiceJobStatus JobCard::getStatus() const
|
|
{
|
|
return m_status;
|
|
}
|
|
|
|
const util::Timestamp& JobCard::getCompletionDate() const
|
|
{
|
|
return m_completionDate;
|
|
}
|
|
|
|
void JobCard::setId(const std::string& id)
|
|
{
|
|
m_id = id;
|
|
}
|
|
|
|
void JobCard::setBookingId(const std::string& bookingId)
|
|
{
|
|
m_bookingId = bookingId;
|
|
}
|
|
|
|
void JobCard::setBooking(ServiceBooking* booking)
|
|
{
|
|
m_booking = booking;
|
|
}
|
|
|
|
void JobCard::setService(Service* service)
|
|
{
|
|
m_service = service;
|
|
}
|
|
|
|
void JobCard::setServiceId(const std::string& serviceId)
|
|
{
|
|
m_serviceId = serviceId;
|
|
}
|
|
|
|
void JobCard::setTechnicianId(const std::string& technicianId)
|
|
{
|
|
m_technicianId = technicianId;
|
|
}
|
|
|
|
void JobCard::setTechnician(User* technician)
|
|
{
|
|
m_technician = technician;
|
|
}
|
|
|
|
void JobCard::setAssignedDate(const util::Timestamp& assignedDate)
|
|
{
|
|
m_assignedDate = assignedDate;
|
|
}
|
|
|
|
void JobCard::setStatus(ServiceJobStatus status)
|
|
{
|
|
m_status = status;
|
|
}
|
|
|
|
void JobCard::setCompletionDate(const util::Timestamp& completionDate)
|
|
{
|
|
m_completionDate = completionDate;
|
|
} |