<?php

use App\Http\Controllers\Addresses\FetchAddressController;
use App\Http\Controllers\Addresses\ListAddressesController;
use App\Http\Controllers\Addresses\ListDistrictsController;
use App\Http\Controllers\Addresses\ListStatesController;
use App\Http\Controllers\Addresses\CreateAddressController;
use App\Http\Controllers\Addresses\UpdateAddressController;
use App\Http\Controllers\Addresses\SetAddressToDefaultController;
use App\Http\Controllers\Addresses\DeleteAddressController;
use App\Http\Controllers\ServiceTypes\FetchServiceTypeController;
use App\Http\Controllers\ServiceTypes\ListServiceTypesController;
use App\Http\Controllers\ServiceTypes\CreateServiceTypeController;
use App\Http\Controllers\ServiceTypes\UpdateServiceTypeController;
use App\Http\Controllers\ServiceTypes\UpdateServiceTypeStatusController;
use App\Http\Controllers\ServiceTypes\DeleteServiceTypeController;
use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'address', 'as' => 'address.'], function () {

    Route::get('/{id}/show', [FetchAddressController::class, 'fetch'])->name('show');

    Route::get('/list', [ListAddressesController::class, 'list'])->name('list');
    Route::get('district/list', [ListDistrictsController::class, 'list'])->name('district.list');
    Route::get('state/list', [ListStatesController::class, 'list'])->name('state.list');

    Route::post('/create', [CreateAddressController::class, 'create'])->name('create');

    Route::put('/update/{id}', [UpdateAddressController::class, 'update'])->name('update');

    Route::put('/{id}/default', [SetAddressToDefaultController::class, 'update'])->name('default');

    Route::delete('/delete/{id}', [DeleteAddressController::class, 'destroy'])->name('delete');

});

Route::group(['prefix' => 'service_type', 'as' => 'service_type.'], function () {

    Route::get('/{id}/show', [FetchServiceTypeController::class, 'fetch'])->name('show');

    Route::get('/list', [ListServiceTypesController::class, 'list'])->name('list');

    Route::post('/create', [CreateServiceTypeController::class, 'create'])->name('create');

    Route::put('/update/{id}', [UpdateServiceTypeController::class, 'update'])->name('update');

    Route::put('/status/{id}/{status}', [UpdateServiceTypeStatusController::class, 'activate'])->where('status', 'active|inactive')->name('status');

    Route::delete('/delete/{id}', [DeleteServiceTypeController::class, 'destroy'])->name('delete');

});
