package de.antco.projekt.model;

import java.math.BigDecimal;

public class WorkOrderItem {
    private final int id;
    private final int workOrderId;
    private final ServiceItem serviceItem;
    private final int quantity;

    public WorkOrderItem(int id, int workOrderId, ServiceItem serviceItem, int quantity) {
        this.id = id;
        this.workOrderId = workOrderId;
        this.serviceItem = serviceItem;
        this.quantity = quantity;
    }

    public int getId() {
        return id;
    }

    public int getWorkOrderId() {
        return workOrderId;
    }

    public ServiceItem getServiceItem() {
        return serviceItem;
    }

    public int getQuantity() {
        return quantity;
    }

    public BigDecimal getTotalPrice() {
        return serviceItem.getPrice().multiply(BigDecimal.valueOf(quantity));
    }
}
