<?php

/**
 * Model for income account codes.
 *
 * @package northmill-online-shared
 */
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 Income_Account_Code_Model
 */
class Vat_Account_Code_Model extends Data_Model implements JsonSerializable
{
    /**
     * Hub ID of the account code.
     *
     * @var string
     */
    protected string $id;
    /**
     * Account code.
     *
     * @var int
     */
    protected int $account_code;
    /**
     * VAT rate that the account code is associated to.
     *
     * @var int
     */
    protected int $vat_rate;
    /**
     * Get account code ID.
     *
     * @return string
     */
    public function get_id(): string
    {
        return $this->id;
    }
    /**
     * Set account code ID.
     *
     * @param string $id Account code ID.
     *
     * @return void
     */
    public function set_id(string $id): void
    {
        $this->id = $id;
    }
    /**
     * Get account code ID.
     *
     * @return ?int
     */
    public function get_account_code(): ?int
    {
        return $this->account_code ?? null;
    }
    /**
     * Set account code ID.
     *
     * @param int $account_code Account code ID.
     *
     * @return void
     */
    public function set_account_code(int $account_code): void
    {
        $this->account_code = $account_code;
    }
    /**
     * Get the account code vat rate.
     *
     * @return ?int
     */
    public function get_vat_rate(): ?int
    {
        return $this->vat_rate ?? null;
    }
    /**
     * Set the account code vat rate.
     *
     * @param ?int $vat_rate Account code vat rate.
     *
     * @return void
     */
    public function set_vat_rate(?int $vat_rate): void
    {
        $this->vat_rate = $vat_rate;
    }
    /**
     * Get data as an array.
     */
    public function jsonSerialize(): array
    {
        return array('id' => $this->id, 'account_code' => $this->account_code, 'vat_rate' => $this->vat_rate);
    }
}
