<?php

namespace NoahVet\Reef\Domain\Tool;

use NoahVet\Reef\Domain\Vat\VatCategoryEnum;

interface VatToolInterface extends ToolInterface
{
    /**
     * E.g.
     *
     * Before
     *
     * 820000 (8200 €) | 2000 percent
     *
     * After
     *
     * 984000 (9840 €, 1640€ added)
     */
    public static function addVat(int $amountWithoutVat, int $vatAmount): int;

    /**
     * E.g.
     *
     * Before
     *
     * 1000 (10 €(HT)) | 1200 (12 €(TTC))
     *
     * After
     *
     * Get 2000 - 20% Vat
     */
    public static function getVat(int $amountWithVat, int $amountWithoutVat): int;

    /**
     * E.g.
     *
     * Before
     *
     * 984000 (9840 €) | 2000 percent
     *
     * After
     *
     * 820000 (8200 €, 1640€ removed)
     */
    public static function removeVat(int $amountWithVat, int $vatAmount): int;

    /**
     * Check if given amounts match the provided VAT category.
     */
    public static function checkVat(
        int $amountWithoutVat,
        int $amountWithVat,
        VatCategoryEnum $vatCategory,
    ): bool;

    public static function getVatCategoryFromAmounts(
        int $amountWithoutVat,
        int $amountWithVat,
    ): VatCategoryEnum;
}
