<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'print-suppliers/printify'], function () {

    Route::post('/fulfill-template', ['uses' => 'PrintifyController@storeFulfillTemplate']);

    Route::any('/get-product-attrs', ['uses' => 'PrintifyController@getProductAttrs']); // serve by trait
    Route::any('/get-fulfill-sku-attrs', ['uses' => 'PrintifyController@getFulfillSkuAttrs']); // serve by trait
    Route::any('/get-fulfill-data', ['uses' => 'PrintifyController@getFulfillData']);
    Route::any('/get-variant-resolution', ['uses' => 'PrintifyController@getVariantResolution']);

    Route::any('/auto-fulfill', ['uses' => 'PrintifyController@autoFulfill']);
    Route::any('/test-auto-fulfill', ['uses' => 'PrintifyController@testAutoFulfill']);

    Route::get('order-detail', 'PrintifyController@getPrintifyOrderDetail');

    Route::post('create-product', 'PrintifyController@createPrintifyProduct');

    Route::get('get-order-profit', 'PrintifyController@getOrderProfit');
    Route::get('trigger-order-webhook', 'PrintifyController@triggerWebhookByOrder');

    Route::any('/send-to-production', ['uses' => 'PrintifyController@submitProduction']);
    Route::get('cancel-order', 'PrintifyController@cancelOrder');
    Route::get('delete-product', 'PrintifyController@deleteProductPrintify');

    Route::any('api', [ 'as' => 'print-suppliers::printify::callApi', 'uses' => 'PrintifyController@callPrintifyApi', ]);

    Route::get('/find-color', 'PrintifyController@findColorCode');

    Route::post('/build-variant-status', ['uses' => 'Build\PrinfityVariantStatusController@build']);

    Route::post('/build-blueprint-detail', ['uses' => 'Services\PrintifyTemplateService@buildBlueprintDetail']);
    Route::post('/save-blueprint-detail', ['uses' => 'Services\PrintifyTemplateService@saveBlueprintDetail'])->name('save-blueprint-detail');
});
