68 lines
1.2 KiB
C++
68 lines
1.2 KiB
C++
/*
|
||
* File: Booking.cpp
|
||
* Description: The Booking class represents a time‑based booking with employee and team details and supports duration calculation.
|
||
* Author: Trenser
|
||
* Created: 31-Mar-2026
|
||
*/
|
||
#include "Booking.h"
|
||
|
||
//Getters and Setters
|
||
const std::string& Booking::getBookingId() const
|
||
{
|
||
return m_id;
|
||
}
|
||
|
||
const util::Timestamp& Booking::getStartTime() const
|
||
{
|
||
return m_startTime;
|
||
}
|
||
|
||
const util::Timestamp& Booking::getEndTime() const
|
||
{
|
||
return m_endTime;
|
||
}
|
||
|
||
const std::string& Booking::getEmployeeId() const
|
||
{
|
||
return m_employeeId;
|
||
}
|
||
|
||
Team* Booking::getTeam() const
|
||
{
|
||
return m_team;
|
||
}
|
||
|
||
void Booking::setBookingId(const std::string& id)
|
||
{
|
||
m_id = id;
|
||
}
|
||
|
||
void Booking::setStartTime(const util::Timestamp& startTime)
|
||
{
|
||
m_startTime = startTime;
|
||
}
|
||
|
||
void Booking::setEndTime(const util::Timestamp& endTime)
|
||
{
|
||
m_endTime = endTime;
|
||
}
|
||
|
||
void Booking::setEmployeeId(const std::string& employeeId)
|
||
{
|
||
m_employeeId = employeeId;
|
||
}
|
||
|
||
void Booking::setTeam(Team* team)
|
||
{
|
||
m_team = team;
|
||
}
|
||
|
||
double Booking::getDurationInHours() const
|
||
{
|
||
return util::Timestamp::getDurationInHours(m_startTime, m_endTime);
|
||
}
|
||
|
||
double Booking::getDurationInMinutes() const
|
||
{
|
||
return util::Timestamp::getDurationInMinutes(m_startTime, m_endTime);
|
||
} |