<?php

namespace PostenBringCheckout\admin\bring\models\booking;

defined( 'ABSPATH' ) || exit;

class Party {
	public ?string $name;
	public string $addressLine;
	public ?string $addressLine2;
	public string $postalCode;
	public string $city;
	public ?string $countryCode;
	public ?string $reference;
	public ?string $additionalAddressInfo;
	public Contact $contact;

	public function __construct(
		?string $name,
		string $addressLine,
		?string $addressLine2,
		string $postalCode,
		string $city,
		?string $countryCode,
		Contact $contact,
		?string $reference = null,
		?string $additionalAddressInfo = null
	) {
		$this->name                  = $name;
		$this->addressLine           = $addressLine;
		$this->addressLine2          = $addressLine2;
		$this->postalCode            = $postalCode;
		$this->city                  = $city;
		$this->countryCode           = $countryCode;
		$this->reference             = $reference;
		$this->additionalAddressInfo = $additionalAddressInfo;
		$this->contact               = $contact;
	}

	public function toArray(): array {
		return get_object_vars( $this );
	}
}
