<?php

/**
 * Model for article account codes.
 *
 * @package northmill-shared-online
 */
declare (strict_types=1);
namespace Northmill_Online_Shared_Sync\Northmill_Online_Shared\Abstracts\Hub_API\Hub_Accounts\Models;

use JsonSerializable;
use Northmill_Online_Shared_Sync\Northmill_Online_Shared\Abstracts\Data_Model;
defined('ABSPATH') || exit;
/**
 * Class Article_Account_Code_Model
 */
class Article_Account_Code_Model extends Data_Model implements JsonSerializable
{
    /**
     * Flo ID of the account code.
     *
     * @var string
     */
    protected string $id;
    /**
     * Name of the account code.
     *
     * @var string
     */
    protected string $name;
    /**
     * Slug account code, used by WooCommerce.
     *
     * @var string
     */
    protected string $slug;
    /**
     * Description of the account code.
     *
     * @var string
     */
    protected string $description;
    /**
     * VAT rate of the account code.
     *
     * @var float
     */
    protected float $vat_rate;
    /**
     * Account code.
     *
     * @var int
     */
    protected int $account_code;
    /**
     * Take-away VAT percentage.
     *
     * @var ?float
     */
    protected ?float $take_away_vat_percentage = null;
    /**
     * Take-away account code.
     *
     * @var ?int
     */
    protected ?int $take_away_account_code = null;
    /**
     * Whether to keep the retail price unchanged when take-away VAT is applied.
     *
     * When true, the inc-VAT retail price stays the same for take-away orders;
     * only the VAT split changes internally (ex-VAT base increases).
     * When false (default), the ex-VAT base stays the same and the inc-VAT
     * retail price drops with the lower take-away VAT rate.
     *
     * @var ?bool
     */
    protected ?bool $keep_retail_price_for_take_away = null;
    /**
     * Cost center.
     *
     * @var string
     */
    protected string $cost_center;
    /**
     * Project.
     *
     * @var string
     */
    protected string $project;
    /**
     * Get the ID of the account code.
     *
     * @return string
     */
    public function get_id(): string
    {
        return $this->id ?? '';
    }
    /**
     * Set the ID of the account code.
     *
     * @param string $id ID of the account code.
     *
     * @return void
     */
    public function set_id(string $id): void
    {
        $this->id = $id;
    }
    /**
     * Get the name of the account code.
     *
     * @return string
     */
    public function get_name(): string
    {
        return $this->name;
    }
    /**
     * Set the name of the account code.
     *
     * @param string $name Name of the account code.
     *
     * @return void
     */
    public function set_name(string $name): void
    {
        $this->name = $name;
    }
    /**
     * Get the slug of the account code.
     *
     * @return string
     */
    public function get_slug(): string
    {
        return $this->slug;
    }
    /**
     * Set the slug of the account code.
     *
     * @param string $slug Slug of the account code.
     *
     * @return void
     */
    public function set_slug(string $slug): void
    {
        $this->slug = $slug;
    }
    /**
     * Get the description of the account code.
     *
     * @return string
     */
    public function get_description(): string
    {
        return $this->description;
    }
    /**
     * Set the description of the account code.
     *
     * @param string $description Description of the account code.
     *
     * @return void
     */
    public function set_description(string $description): void
    {
        $this->description = $description;
    }
    /**
     * Get the account code vat rate.
     *
     * @return ?float
     */
    public function get_vat_rate(): ?float
    {
        return $this->vat_rate ?? null;
    }
    /**
     * Set the account code vat rate.
     *
     * @param ?float $vat_rate Account code vat rate.
     *
     * @return void
     */
    public function set_vat_rate(?float $vat_rate): void
    {
        $this->vat_rate = $vat_rate;
    }
    /**
     * Get the account code.
     *
     * @return ?int
     */
    public function get_account_code(): ?int
    {
        return $this->account_code ?? null;
    }
    /**
     * Set the account code.
     *
     * @param ?int $account_code Account code.
     *
     * @return void
     */
    public function set_account_code(?int $account_code): void
    {
        $this->account_code = $account_code;
    }
    /**
     * Get the take-away VAT percentage.
     *
     * @return ?float
     */
    public function get_take_away_vat_percentage(): ?float
    {
        return $this->take_away_vat_percentage;
    }
    /**
     * Set the take-away VAT percentage.
     *
     * @param ?float $take_away_vat_percentage Take-away VAT percentage.
     *
     * @return void
     */
    public function set_take_away_vat_percentage(?float $take_away_vat_percentage): void
    {
        $this->take_away_vat_percentage = $take_away_vat_percentage;
    }
    /**
     * Get the take-away account code.
     *
     * @return ?int
     */
    public function get_take_away_account_code(): ?int
    {
        return $this->take_away_account_code;
    }
    /**
     * Set the take-away account code.
     *
     * @param ?int $take_away_account_code Take-away account code.
     *
     * @return void
     */
    public function set_take_away_account_code(?int $take_away_account_code): void
    {
        $this->take_away_account_code = $take_away_account_code;
    }
    /**
     * Get the keep-retail-price-for-take-away flag.
     *
     * @return ?bool
     */
    public function get_keep_retail_price_for_take_away(): ?bool
    {
        return $this->keep_retail_price_for_take_away;
    }
    /**
     * Set the keep-retail-price-for-take-away flag.
     *
     * @param ?bool $keep_retail_price_for_take_away Whether to keep retail price unchanged for take-away.
     *
     * @return void
     */
    public function set_keep_retail_price_for_take_away(?bool $keep_retail_price_for_take_away): void
    {
        $this->keep_retail_price_for_take_away = $keep_retail_price_for_take_away;
    }
    /**
     * Get the cost center.
     *
     * @return string
     */
    public function get_cost_center(): string
    {
        return $this->cost_center ?? '';
    }
    /**
     * Set the cost center.
     *
     * @param string $cost_center Cost center.
     *
     * @return void
     */
    public function set_cost_center(string $cost_center): void
    {
        $this->cost_center = $cost_center;
    }
    /**
     * Get the project.
     *
     * @return string
     */
    public function get_project(): string
    {
        return $this->project ?? '';
    }
    /**
     * Set the project.
     *
     * @param string $project Project.
     *
     * @return void
     */
    public function set_project(string $project): void
    {
        $this->project = $project;
    }
    /**
     * Get data for json serialization.
     */
    public function jsonSerialize(): array
    {
        return array('id' => $this->get_id(), 'name' => $this->get_name(), 'slug' => $this->get_slug(), 'description' => $this->get_description(), 'vat_rate' => $this->get_vat_rate(), 'account_code' => $this->get_account_code(), 'take_away_vat_percentage' => $this->get_take_away_vat_percentage(), 'take_away_account_code' => $this->get_take_away_account_code(), 'keep_retail_price_for_take_away' => $this->get_keep_retail_price_for_take_away(), 'cost_center' => $this->get_cost_center(), 'project' => $this->get_project());
    }
}
