<?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 Income_Account_Code_Model extends Data_Model implements JsonSerializable
{
    /**
     * Flo ID of the account code.
     *
     * @var string
     */
    protected string $id;
    /**
     * Account code.
     *
     * @var int
     */
    protected int $account_code;
    /**
     * ID of the payment method account code is associated to.
     *
     * @var string
     */
    protected string $payment_method_id;
    /**
     * 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.
     *
     * @return ?int
     */
    public function get_account_code(): ?int
    {
        return $this->account_code ?? null;
    }
    /**
     * Set 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 payment method ID.
     *
     * @return string
     */
    public function get_payment_method_id(): string
    {
        return $this->payment_method_id ?? '';
    }
    /**
     * Set payment method ID.
     *
     * @param string $payment_method_id Payment method ID.
     *
     * @return void
     */
    public function set_payment_method_id(string $payment_method_id): void
    {
        $this->payment_method_id = $payment_method_id;
    }
    /**
     * Get data as an array.
     */
    public function jsonSerialize(): array
    {
        return array('id' => $this->get_id(), 'account_code' => $this->get_account_code(), 'payment_method_id' => $this->get_payment_method_id());
    }
}
