make(Illuminate\Contracts\Console\Kernel::class); $kernel->bootstrap(); $service = new App\Services\PriceCalculatorService(); $testCases = [ [ 'name' => 'PARCEL Export to AE 1kg', 'data' => [ 'type' => 'PARCEL', 'direction' => 'Outbound', 'country_iso' => 'AE', 'weight' => 1, 'volumetric_weight' => 1, 'extra_service' => 0, 'packing_cost' => 100000, 'domestic_pickup' => 0, 'domestic_delivery' => 0, 'warehousing_cost' => 0, 'discount' => 0, ], ], [ 'name' => 'DOC_NORMAL Export to DE 0.5kg', 'data' => [ 'type' => 'DOC_NORMAL', 'direction' => 'Outbound', 'country_iso' => 'DE', 'weight' => 0.5, 'volumetric_weight' => 0.5, 'extra_service' => 0, 'packing_cost' => 100000, 'domestic_pickup' => 0, 'domestic_delivery' => 0, 'warehousing_cost' => 0, 'discount' => 0, ], ], [ 'name' => 'PARCEL Import from US 5kg', 'data' => [ 'type' => 'PARCEL', 'direction' => 'Inbound', 'country_iso' => 'US', 'weight' => 5, 'volumetric_weight' => 5, 'extra_service' => 50000, 'packing_cost' => 150000, 'domestic_pickup' => 20000, 'domestic_delivery' => 30000, 'warehousing_cost' => 50000, 'discount' => 10000, ], ], ]; foreach ($testCases as $case) { echo "=== {$case['name']} ===" . PHP_EOL; try { $result = $service->calculate($case['data']); echo "Base Price (AED): " . $result['base_price'] . PHP_EOL; echo "Net Dirham: " . $result['net_dirham'] . PHP_EOL; echo "Net Rial: " . number_format($result['net_rial'], 0) . PHP_EOL; echo "Extra Service: " . number_format($result['extra_service'], 0) . PHP_EOL; echo "Packing Cost: " . number_format($result['packing_cost'], 0) . PHP_EOL; echo "VAT Amount: " . number_format($result['vat_amount'], 0) . PHP_EOL; echo "Total Fee: " . number_format($result['total_fee'], 0) . PHP_EOL; echo "Zone: " . $result['zone'] . PHP_EOL; echo "Chargeable Weight: " . $result['chargeable_weight'] . PHP_EOL; } catch (Exception $e) { echo "ERROR: " . $e->getMessage() . PHP_EOL; } echo PHP_EOL; }