<?php

namespace PostenBringCheckout\admin\api\models;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class MybringCustomerAndServices {
	public string $customerNumber;
	public string $name;
	public string $displayName;
	public bool $defaultCustomer;
	public array $services;

	public function __construct( array $data ) {
		$this->customerNumber  = $data['customerNumber'];
		$this->name            = $data['name'];
		$this->displayName     = $data['displayName'];
		$this->defaultCustomer = $data['defaultCustomer'];
		$this->services        = array_map(
			function ( $service ) {
				return new MybringService( $service );
			},
			$data['services']
		);
	}
}
