```
<?php
declare(strict_types=1);

namespace app\helpers;

/**
* Package Policy Helper
* 
* Conceptual Flow:
* From your artwork/order data — you have:
* 	- Artwork value ($orderValueUsd)
* 	- Artwork dimensions ($widthFt, $heightFt)
* 	- Fragility info ($isFragile)
* 
* Pass these to PackagingPolicyHelper::determinePackaging(), which returns:
* 	- Packaging type (crate, reinforced box, etc.)
* 	- Packaging fee in cents
* 	- Description text for UI or logs
* 
* Use that packaging fee ($packaging['fee_cents']) as input into your shipping cost 
* calculator — replace or override the $customCrateFeeCents parameter in 
* calculateShippingTotal().
* 
* Example integrated usage:
* 
* Step 1: Collect artwork/order data
* 
* 	$orderValueUsd = 12000.0;// $12,000 declared value
* 	$widthFt = 3.0;
* 	$heightFt = 4.0;
* 	$isFragile = true;
* 	
* 	$sizeSqFt = $widthFt * $heightFt;
* 	
* Step 2: Determine appropriate packaging type & fee
* 
* 	$packaging = PackagingPolicyHelper::determinePackaging(
* 		$orderValueUsd,
* 		$sizeSqFt,
* 		$isFragile
* 	);
* 	
* Step 3: Calculate total shipping cost
* 
* 	$orderValueCents = 1200000;// $12,000 in cents
* 	$carrierRateCents = 20000;// e.g. $200 carrier base fee
* 	$signageFeeCents = 1000;// $10 signage
* 	$insuranceRate = 0.01;// 1%
* 	$insuranceMinFeeCents = 300;// $3 minimum insurance
* 	$whiteGloveFeeCents = 20000; // $200 white glove fee
* 	
* 	$totalShippingCents = MoneyHelper::calculateShippingTotal(
* 		$orderValueCents,
* 		$carrierRateCents,
* 		$signageFeeCents,
* 		$insuranceRate,
* 		$insuranceMinFeeCents,
* 		$whiteGloveFeeCents,
* 		$packaging['fee_cents']// use dynamically determined packaging fee here
* 	);
* 	
* 	echo "Total Shipping Cost: $" . ($totalShippingCents / 100) . PHP_EOL;
* 	echo "Packaging type: " . $packaging['type'] . PHP_EOL;
* 	echo "Packaging description: " . $packaging['description'] . PHP_EOL;
*/
class PackagingHelper
{
	/**
	* Determine packaging type and fee based on artwork parameters including 3D size.
	* @param float $valueUSD Declared value in USD.
	* @param float $widthCm Width in centimeters.
	* @param float $heightCm Height in centimeters.
	* @param float $depthCm Depth in centimeters.
	* @param bool $fragile Is artwork fragile?
	*
	* @return array Packaging info keys:
	* 	- 'type' => string ['crate', 'reinforced_box', 'specialty_box', 'standard_box']
	* 	- 'fee_cents' => int Estimated packaging fee in cents
	* 	- 'description' => string Human-readable explanation
	*/
	public static function determinePackaging(
		float $valueUSD,
		float $widthCm,
		float $heightCm,
		float $depthCm,
		bool $fragile
	): array
	{
		// Thresholds — you can adjust as needed
		$valueThreshold = 2500.0;// $5,000
		$sizeThreshold = 4.0;// 4 square feet (e.g. 2ft x 2ft)
		
		if ($fragile)
		{
			return [
				'type' => 'crate',
				'fee_cents' => 50000,// $500 for crate
				'description' => \Yii::t('app', 'Fragile item; custom crate required for maximum protection.')
			];
		}
		if ($valueUSD > $valueThreshold)
		{
			return [
				'type' => 'crate',
				'fee_cents' => 50000,
				'description' => \Yii::t('app', 'High value item; crate recommended to ensure safety.')
			];
		}
		if ($sizeSqFt > $sizeThreshold)
		{
			return [
				'type' => 'reinforced_box',
				'fee_cents' => 20000,// $200 reinforced box
				'description' => \Yii::t('app', 'Oversized item; reinforced packaging needed.')
			];
		}
		if ($sizeSqFt > 1.0)
		{
			return [
				'type' => 'specialty_box',
				'fee_cents' => 10000,// $100 specialty box/portfolio
				'description' => \Yii::t('app', 'Medium size item; specialty box recommended.')
			];
		}
		
		return [
			'type' => 'standard_box',
			'fee_cents' => 5000,// $50 standard box with padding
			'description' => \Yii::t('app', 'Small and not fragile; standard padded box suitable.')
		];
    }
}
```
We were last talking and wanted to update PackagingHelper to handle xyz for packages

I setted up the migration tables for product and order item activeRecord like so
```
class m250728_171510_add_packaging_fields_order_table extends Migration
{
	public function safeUp()
	{
		$tableOptions = null;
		if ($this->db->driverName === 'mysql')
		{
			// @url http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
			$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
		}
		
		$this->addColumn('{{%order_item}}', 'declared_value_cents', $this->integer()->after('quantity'));
		$this->addColumn('{{%order_item}}', 'width_cm', $this->float()->after('declared_value_cents'));
		$this->addColumn('{{%order_item}}', 'height_cm', $this->float()->after('width_cm'));
		$this->addColumn('{{%order_item}}', 'depth_cm', $this->float()->after('height_cm'));
		$this->addColumn('{{%order_item}}', 'weight_g', $this->float()->after('depth_cm'));
		$this->addColumn('{{%order_item}}', 'fragile', $this->boolean()->defaultValue(false)->after('weight_g'));
		$this->addColumn('{{%order_item}}', 'packaging_type', $this->string(64)->after('fragile'));
		$this->addColumn('{{%order_item}}', 'packaging_fee_cents', $this->integer()->after('packaging_type'));
		$this->addColumn('{{%order_item}}', 'white_glove_required', $this->boolean()->defaultValue(false)->after('packaging_fee_cents'));
	}
	
	public function safeDown()
	{
		echo "m250728_171510_add_packaging_fields_order_table.\n";
		
		return false;
	}
}

class m250728_171558_add_packaging_fields_content_table extends Migration
{
	public function safeUp()
	{
		$tableOptions = null;
		if ($this->db->driverName === 'mysql')
		{
			// @url http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
			$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
		}
		
		$this->addColumn('{{%content}}', 'width_cm', $this->float()->after('name'));
		$this->addColumn('{{%content}}', 'height_cm', $this->float()->after('width_cm'));
		$this->addColumn('{{%content}}', 'depth_cm', $this->float()->after('height_cm'));
		$this->addColumn('{{%content}}', 'weight_g', $this->float()->after('depth_cm'));
		$this->addColumn('{{%content}}', 'fragile', $this->boolean()->defaultValue(false)->after('weight_g'));
		$this->addColumn('{{%content}}', 'value_usd', $this->decimal(10,2)->after('fragile'));
		$this->addColumn('{{%content}}', 'packaging_type', $this->string(64)->after('value_usd'));
		$this->addColumn('{{%content}}', 'packaging_fee_cents', $this->integer()->after('packaging_type'));
	}
	
	public function safeDown()
	{
		echo "m250728_171558_add_packaging_fields_content_table.\n";
		
		return false;
	}
}
```