<?php

/**
 * Receipt Merchant model.
 *
 * @package northmill-online-shared
 */
declare (strict_types=1);
namespace Northmill_Online_Shared_Sync\Northmill_Online_Shared\Abstracts\Hub_API\Models\Receipts;

use JsonSerializable;
/**
 * Class Merchant_Model
 */
class Receipt_Merchant_Model implements JsonSerializable
{
    /**
     * Organization number for the merchant.
     *
     * @var string
     */
    protected string $CorporateIdentityNumber;
    /**
     * Organization name for the merchant.
     *
     * @var string
     */
    protected string $Name;
    /**
     * Address line 1 for the merchant.
     *
     * @var string
     */
    protected string $AddressLine1;
    /**
     * Address line 2 for the merchant.
     *
     * @var string
     */
    protected string $AddressLine2;
    /**
     * Zip code for the merchant.
     *
     * @var string
     */
    protected string $ZipCode;
    /**
     * City for the merchant.
     *
     * @var string
     */
    protected string $City;
    /**
     * Country for the merchant.
     *
     * @var string
     */
    protected string $Country;
    /**
     * Merchant home page.
     * Defaults to URL of this site.
     *
     * @var string
     */
    protected string $HomePage;
    /**
     * Merchant phone number.
     *
     * @var string|null
     */
    protected ?string $Phone;
    /**
     * Merchant email address.
     *
     * @var string|null
     */
    protected ?string $Email;
    public function __construct(string $corporate_identity_number, string $name, string $address_line1, string $address_line2, string $zip_code, string $city, string $country, ?string $home_page = null, ?string $phone = null, ?string $email = null)
    {
        $this->CorporateIdentityNumber = $corporate_identity_number;
        $this->Name = $name;
        $this->AddressLine1 = $address_line1;
        $this->AddressLine2 = $address_line2;
        $this->ZipCode = $zip_code;
        $this->City = $city;
        $this->Country = $country;
        $this->HomePage = $home_page ?? get_site_url();
        $this->Phone = $phone;
        $this->Email = $email;
    }
    public function jsonSerialize(): array
    {
        return array('CorporateIdentityNumber' => $this->CorporateIdentityNumber, 'Name' => $this->Name, 'AddressLine1' => $this->AddressLine1, 'AddressLine2' => $this->AddressLine2, 'ZipCode' => $this->ZipCode, 'City' => $this->City, 'Country' => $this->Country, 'Phone' => $this->Phone, 'HomePage' => $this->HomePage, 'Email' => $this->Email);
    }
}
