<?php

namespace App\Classes\ValueObjects\Constants;

final class OrderSteps
{
    public const PROCESSING = 'PROCESSING';
    public const PACKING = 'PACKING';
    public const SHIPPING = 'SHIPPING';
    public const DELIVERY = 'DELIVERY';

    public const WAREHOUSE_RECEIVING = 'WAREHOUSE_RECEIVING';
    public const WAREHOUSE_LOAD_CONTAINER = 'WAREHOUSE_LOAD_CONTAINER';
    public const WAREHOUSE_ARRIVAL = 'WAREHOUSE_ARRIVAL';
    public const WAREHOUSE_UNLOAD_CONTAINER = 'WAREHOUSE_UNLOAD_CONTAINER';

    /*
    public const COMPANY_PROCESSING_CATEGORY = 'processing';
    public const COMPANY_SHIPPING_CATEGORY = 'shipping';
    public const COMPANY_RECEIVING_CATEGORY = 'receiving';
    public const COMPANY_COMPLETE_CATEGORY = 'complete';
    public const COMPANY_CANCEL_CATEGORY = 'cancel';

    public const ORDER_PROCESSING_STEP = 'PS_PROCESSING';
    public const ORDER_SHIPPING_STEP = 'PS_SHIPPING';
    public const ORDER_DELIVERY_STEP = 'PS_DELIVERY';

    public const ORDER_MODULE_WAREHOUSE = 'WAREHOUSE';
    public const ORDER_WAREHOUSE_RECEIVING_STEP = 'MS_WAREHOUSE_RECEIVING';
    public const ORDER_WAREHOUSE_PACKING_STEP = 'MS_WAREHOUSE_PACKING';
    public const ORDER_WAREHOUSE_ARRIVAL_STEP = 'MS_WAREHOUSE_ARRIVAL';
    public const ORDER_WAREHOUSE_UNPACKING_STEP = 'MS_WAREHOUSE_UNPACKING';

    public const ORDER_MODULE_NO_WAREHOUSE = 'NO_WAREHOUSE';
    public const ORDER_NO_WAREHOUSE_PENDING_SUPPLIER = 'MS_NO_WAREHOUSE_PENDING_SUPPLIER';


    public const ORDER_PRIMARY_STEPS = [
        Steps::ORDER_PROCESSING_STEP => [
            'initial_name' => 'processing order',
            'final_name' => 'order confirmed',
            'description' => 'Order created and pending confirmation',
            'sequence' => 0
        ]
    ];

    public const ORDER_PRIMARY_MODULAR_STEPS = [
        Steps::ORDER_SHIPPING_STEP => [
            'initial_name' => 'shipping',
            'final_name' => 'shipped out',
            'description' => 'Order is Loaded to Container, waiting for Shipment',
            'sequence' => 1
        ],
        Steps::ORDER_DELIVERY_STEP => [
            'initial_name' => 'delivery',
            'final_name' => 'Received',
            'description' => 'Order out for delivery soon',
            'sequence' => 2
        ],
    ];

    public const ORDER_MODULAR_STEPS = [
        Steps::ORDER_MODULE_WAREHOUSE => [
            'china_warehouse' => [
                'previous' => Steps::ORDER_PROCESSING_STEP,
                'next' => Steps::ORDER_SHIPPING_STEP,
                'steps' => [
                    Steps::ORDER_WAREHOUSE_RECEIVING_STEP => [
                        'initial_name' => 'pending supplier',
                        'final_name' => 'arrived at warehouse',
                        'description' => 'Waiting for supplier to deliver order to warehouse'
                    ],
                    Steps::ORDER_WAREHOUSE_PACKING_STEP => [
                        'initial_name' => 'packing',
                        'final_name' => 'packed',
                        'description' => 'Packing order into shipping container'
                    ]
                ]
            ],
            'malaysia_warehouse' => [
                'previous' => Steps::ORDER_SHIPPING_STEP,
                'next' => Steps::ORDER_DELIVERY_STEP,
                'steps' => [
                    Steps::ORDER_WAREHOUSE_ARRIVAL_STEP => [
                        'initial_name' => 'pending arrival',
                        'final_name' => 'arrived at warehouse',
                        'description' => 'Waiting for order\'s arrival & custom clearance'
                    ],
                    Steps::ORDER_WAREHOUSE_UNPACKING_STEP => [
                        'initial_name' => 'unpacking',
                        'final_name' => 'unpacked',
                        'description' => 'Unpacking order from shipping container'
                    ]
                ]
            ]
        ],
        Steps::ORDER_MODULE_NO_WAREHOUSE => [
            'pending_arrival' => [
                'previous' => Steps::ORDER_PROCESSING_STEP,
                'next' => Steps::ORDER_SHIPPING_STEP,
                'steps' => [
                    Steps::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER => [
                        'initial_name' => 'pending supplier',
                        'final_name' => 'supplier packed order',
                        'description' => 'Waiting for supplier to pack order for shipping'
                    ]
                ]
            ]

        ],
    ];

    public const COMPANY_ORDER_PROCESSING = [
        Steps::ORDER_PROCESSING_STEP,
        Steps::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER,
        Steps::ORDER_WAREHOUSE_RECEIVING_STEP
    ];

    public const COMPANY_ORDER_SHIPPING = [
        Steps::ORDER_WAREHOUSE_PACKING_STEP,
        Steps::ORDER_SHIPPING_STEP
    ];

    public const COMPANY_ORDER_RECEIVING = [
        Steps::ORDER_WAREHOUSE_ARRIVAL_STEP,
        Steps::ORDER_WAREHOUSE_UNPACKING_STEP,
        Steps::ORDER_DELIVERY_STEP

    ];

    public const WAREHOUSE_RECEIVING_CATEGORY = 'receiving';
    public const WAREHOUSE_SHIPPING_CATEGORY = 'shipping';
    public const WAREHOUSE_COMPLETE_CATEGORY = 'complete';
    public const WAREHOUSE_CANCEL_CATEGORY = 'cancel';

    public const WAREHOUSE_ORDER_RECEIVING = [
        Steps::ORDER_WAREHOUSE_RECEIVING_STEP
    ];

    public const WAREHOUSE_ORDER_SHIPPING = [
        Steps::ORDER_WAREHOUSE_PACKING_STEP,
        Steps::ORDER_SHIPPING_STEP,
    ];

    public const WAREHOUSE_ORDER_COMPLETE = [
        Steps::ORDER_WAREHOUSE_ARRIVAL_STEP,
        Steps::ORDER_WAREHOUSE_UNPACKING_STEP,
        Steps::ORDER_DELIVERY_STEP
    ];

    public const STEP_PROCESSOR = [
        Steps::ORDER_PROCESSING_STEP => ConfirmsOrder::class,
        Steps::ORDER_WAREHOUSE_RECEIVING_STEP => WarehouseReceivesOrder::class,
        Steps::ORDER_WAREHOUSE_PACKING_STEP => WarehousePackOrder::class,
        Steps::ORDER_SHIPPING_STEP => ShipOrder::class,
        Steps::ORDER_WAREHOUSE_ARRIVAL_STEP => WarehouseArrivalOrder::class,
        Steps::ORDER_WAREHOUSE_UNPACKING_STEP => WarehouseUnpackingOrder::class,
        Steps::ORDER_DELIVERY_STEP => DeliverOrder::class,
    ];
*/
}
