<?php
/**
 * Receipt Customer model.
 *
 * @package northmill-online-shared
 */

declare(strict_types=1);

namespace Northmill_Online_Shared\Abstracts\Hub_API\Models\Receipts;

use JsonSerializable;

/**
 * Class Customer_Model
 */
class Receipt_Customer_Model implements JsonSerializable {
	/**
	 * Customer number as in Hub.
	 *
	 * @var string
	 */
	protected string $CustomerNumber;

	/**
	 * Company name.
	 *
	 * @var string|null
	 */
	protected ?string $CompanyName;

	/**
	 * Full name of the customer.
	 *
	 * @var string
	 */
	protected string $Fullname;

	/**
	 * Type of customer.
	 *
	 * @var string
	 */
	protected string $CustomerType;

	public function __construct(
		string $customer_number,
		string $full_name,
		string $customer_type,
		?string $company_name = null
	) {
		$this->CustomerNumber = $customer_number;
		$this->Fullname       = $full_name;
		$this->CustomerType   = $customer_type;
		$this->CompanyName    = $company_name;
	}

	/**
	 * Get data for json serialization.
	 *
	 * @return array
	 */
	public function jsonSerialize(): array {
		return array(
			'CustomerNumber' => $this->CustomerNumber,
			'CompanyName'    => $this->CompanyName,
			'Fullname'       => $this->Fullname,
			'CustomerType'   => $this->CustomerType,
		);
	}
}
