93 lines
3.1 KiB
C++
93 lines
3.1 KiB
C++
/*
|
|
File: Invoice.h
|
|
Description: Declares the Invoice class which represents billing details for a service booking in the Vehicle Service Management System.
|
|
Each invoice includes booking information, labor cost, parts used, discount percentage, total amount, payment details, and status.
|
|
Author: Trenser
|
|
Date: 19-May-2026
|
|
*/
|
|
|
|
|
|
#pragma once
|
|
#include <string>
|
|
#include "Map.h"
|
|
#include "Vector.h"
|
|
#include "Timestamp.h"
|
|
#include "Enums.h"
|
|
|
|
class ServiceBooking;
|
|
class InventoryItem;
|
|
|
|
class Invoice
|
|
{
|
|
private:
|
|
static int m_uid;
|
|
std::string m_id;
|
|
std::string m_bookingId;
|
|
ServiceBooking* m_booking;
|
|
util::Timestamp m_invoiceDate;
|
|
double m_laborCost;
|
|
util::Vector<std::string> m_partIDs;
|
|
util::Map<std::string, InventoryItem*> m_parts;
|
|
double m_partsCost;
|
|
double m_discountPercentage;
|
|
double m_totalAmount;
|
|
util::Timestamp m_paymentDate;
|
|
util::PaymentMode m_paymentMethod;
|
|
util::PaymentStatus m_status;
|
|
public:
|
|
Invoice();
|
|
Invoice(
|
|
const std::string& bookingId,
|
|
ServiceBooking* booking,
|
|
const util::Timestamp& invoiceDate,
|
|
double laborCost, const util::Map<std::string,
|
|
InventoryItem*>& parts,
|
|
double partsCost,
|
|
double discountPercentage,
|
|
double totalAmount,
|
|
const util::Timestamp& paymentDate,
|
|
util::PaymentMode paymentMethod,
|
|
util::PaymentStatus status
|
|
);
|
|
Invoice(
|
|
const std::string& id,
|
|
const std::string& bookingId,
|
|
const util::Timestamp& invoiceDate,
|
|
const util::Vector<std::string>& partIDs,
|
|
double laborCost,
|
|
double partsCost,
|
|
double discountPercentage,
|
|
double totalAmount,
|
|
const util::Timestamp& paymentDate,
|
|
util::PaymentMode paymentMethod,
|
|
util::PaymentStatus status
|
|
);
|
|
const std::string& getId() const;
|
|
const std::string& getBookingId() const;
|
|
ServiceBooking* getBooking() const;
|
|
const util::Timestamp& getInvoiceDate() const;
|
|
double getLaborCost() const;
|
|
const util::Vector<std::string>& getPartIDs() const;
|
|
const util::Map<std::string, InventoryItem*>& getParts() const;
|
|
double getPartsCost() const;
|
|
double getDiscountPercentage() const;
|
|
double getTotalAmount() const;
|
|
const util::Timestamp& getPaymentDate() const;
|
|
util::PaymentMode getPaymentMethod() const;
|
|
util::PaymentStatus getStatus() const;
|
|
void setId(const std::string& id);
|
|
void setBookingId(const std::string& bookingId);
|
|
void setBooking(ServiceBooking* booking);
|
|
void setInvoiceDate(const util::Timestamp& invoiceDate);
|
|
void setLaborCost(double laborCost);
|
|
void setParts(const util::Map<std::string, InventoryItem*>& parts);
|
|
void setPartsCost(double partsCost);
|
|
void setDiscountPercentage(double discountPercentage);
|
|
void setTotalAmount(double totalAmount);
|
|
void setPaymentDate(const util::Timestamp& paymentDate);
|
|
void setPaymentMethod(util::PaymentMode paymentMethod);
|
|
void setStatus(util::PaymentStatus status);
|
|
std::string serialize() const;
|
|
static Invoice* deserialize(const std::string&);
|
|
static std::string getHeaders();
|
|
}; |