<?php

namespace PostenBringCheckout\admin\bring\models\booking;

defined( 'ABSPATH' ) || exit;

class Package {
	public float $weightInKg;
	public ?float $volumeInDm3;

	public Dimensions $dimensions;
	public ?string $correlationId;

	public function __construct( float $weightInKg, ?float $volumeInDm3, ?Dimensions $dimensions, ?string $correlationId = null ) {
		$this->weightInKg    = $weightInKg;
		$this->volumeInDm3   = $volumeInDm3;
		$this->dimensions    = $dimensions ?? new Dimensions( 0, 0, 0 );
		$this->correlationId = $correlationId;
	}

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