<?php
/**
 * BookiFlex Core
 *
 * @package    BookiFlex
 * @subpackage Core
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */


declare(strict_types=1);
namespace BookiFlex\Core\Model\DateUnit\Calculator\Strategy;

use BookiFlex\Core\ValueObject\MoneyAmount;

defined( 'ABSPATH' ) || exit;

/**
 * "Per person" price calculation strategy
 * All prices are multiplied by the number of guests
 */
class PerPersonPriceCalculator extends StandardPriceCalculator
{
    public function getName(): string
    {
        return 'per_person';
    }

    /**
     * In this strategy all prices are multiplied by quantity
     */
    protected function calculateTotal(string $placementType, MoneyAmount $unitPrice, int $quantity): MoneyAmount
    {
        return $unitPrice->multiply($quantity);
    }
}
