import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../../../wayfinder'
/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
export const products = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: products.url(options),
    method: 'get',
})

products.definition = {
    methods: ["get","head"],
    url: '/api/v1/products',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
products.url = (options?: RouteQueryOptions) => {
    return products.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
products.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: products.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
products.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: products.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
const productsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: products.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
productsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: products.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::products
* @see app/Http/Controllers/Api/V1/CatalogController.php:13
* @route '/api/v1/products'
*/
productsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: products.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

products.form = productsForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:27
* @route '/api/v1/products'
*/
export const storeProduct = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeProduct.url(options),
    method: 'post',
})

storeProduct.definition = {
    methods: ["post"],
    url: '/api/v1/products',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:27
* @route '/api/v1/products'
*/
storeProduct.url = (options?: RouteQueryOptions) => {
    return storeProduct.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:27
* @route '/api/v1/products'
*/
storeProduct.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeProduct.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:27
* @route '/api/v1/products'
*/
const storeProductForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeProduct.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:27
* @route '/api/v1/products'
*/
storeProductForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeProduct.url(options),
    method: 'post',
})

storeProduct.form = storeProductForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
export const showProduct = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showProduct.url(args, options),
    method: 'get',
})

showProduct.definition = {
    methods: ["get","head"],
    url: '/api/v1/products/{product}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
showProduct.url = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { product: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { product: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            product: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        product: typeof args.product === 'object'
        ? args.product.id
        : args.product,
    }

    return showProduct.definition.url
            .replace('{product}', parsedArgs.product.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
showProduct.get = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showProduct.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
showProduct.head = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: showProduct.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
const showProductForm = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showProduct.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
showProductForm.get = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showProduct.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:20
* @route '/api/v1/products/{product}'
*/
showProductForm.head = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showProduct.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

showProduct.form = showProductForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:50
* @route '/api/v1/products/{product}'
*/
export const updateProduct = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateProduct.url(args, options),
    method: 'patch',
})

updateProduct.definition = {
    methods: ["patch"],
    url: '/api/v1/products/{product}',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:50
* @route '/api/v1/products/{product}'
*/
updateProduct.url = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { product: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { product: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            product: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        product: typeof args.product === 'object'
        ? args.product.id
        : args.product,
    }

    return updateProduct.definition.url
            .replace('{product}', parsedArgs.product.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:50
* @route '/api/v1/products/{product}'
*/
updateProduct.patch = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateProduct.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:50
* @route '/api/v1/products/{product}'
*/
const updateProductForm = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateProduct.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:50
* @route '/api/v1/products/{product}'
*/
updateProductForm.patch = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateProduct.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

updateProduct.form = updateProductForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroyProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:69
* @route '/api/v1/products/{product}'
*/
export const destroyProduct = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyProduct.url(args, options),
    method: 'delete',
})

destroyProduct.definition = {
    methods: ["delete"],
    url: '/api/v1/products/{product}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroyProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:69
* @route '/api/v1/products/{product}'
*/
destroyProduct.url = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { product: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { product: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            product: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        product: typeof args.product === 'object'
        ? args.product.id
        : args.product,
    }

    return destroyProduct.definition.url
            .replace('{product}', parsedArgs.product.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroyProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:69
* @route '/api/v1/products/{product}'
*/
destroyProduct.delete = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyProduct.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroyProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:69
* @route '/api/v1/products/{product}'
*/
const destroyProductForm = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyProduct.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroyProduct
* @see app/Http/Controllers/Api/V1/CatalogController.php:69
* @route '/api/v1/products/{product}'
*/
destroyProductForm.delete = (args: { product: string | number | { id: string | number } } | [product: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyProduct.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroyProduct.form = destroyProductForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
export const suppliers = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: suppliers.url(options),
    method: 'get',
})

suppliers.definition = {
    methods: ["get","head"],
    url: '/api/v1/suppliers',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
suppliers.url = (options?: RouteQueryOptions) => {
    return suppliers.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
suppliers.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: suppliers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
suppliers.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: suppliers.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
const suppliersForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: suppliers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
suppliersForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: suppliers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::suppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:77
* @route '/api/v1/suppliers'
*/
suppliersForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: suppliers.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

suppliers.form = suppliersForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:91
* @route '/api/v1/suppliers'
*/
export const storeSupplier = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeSupplier.url(options),
    method: 'post',
})

storeSupplier.definition = {
    methods: ["post"],
    url: '/api/v1/suppliers',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:91
* @route '/api/v1/suppliers'
*/
storeSupplier.url = (options?: RouteQueryOptions) => {
    return storeSupplier.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:91
* @route '/api/v1/suppliers'
*/
storeSupplier.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeSupplier.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:91
* @route '/api/v1/suppliers'
*/
const storeSupplierForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeSupplier.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:91
* @route '/api/v1/suppliers'
*/
storeSupplierForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeSupplier.url(options),
    method: 'post',
})

storeSupplier.form = storeSupplierForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
export const showSupplier = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showSupplier.url(args, options),
    method: 'get',
})

showSupplier.definition = {
    methods: ["get","head"],
    url: '/api/v1/suppliers/{supplier}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
showSupplier.url = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { supplier: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { supplier: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            supplier: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        supplier: typeof args.supplier === 'object'
        ? args.supplier.id
        : args.supplier,
    }

    return showSupplier.definition.url
            .replace('{supplier}', parsedArgs.supplier.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
showSupplier.get = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showSupplier.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
showSupplier.head = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: showSupplier.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
const showSupplierForm = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showSupplier.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
showSupplierForm.get = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showSupplier.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:84
* @route '/api/v1/suppliers/{supplier}'
*/
showSupplierForm.head = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showSupplier.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

showSupplier.form = showSupplierForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:110
* @route '/api/v1/suppliers/{supplier}'
*/
export const updateSupplier = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateSupplier.url(args, options),
    method: 'patch',
})

updateSupplier.definition = {
    methods: ["patch"],
    url: '/api/v1/suppliers/{supplier}',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:110
* @route '/api/v1/suppliers/{supplier}'
*/
updateSupplier.url = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { supplier: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { supplier: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            supplier: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        supplier: typeof args.supplier === 'object'
        ? args.supplier.id
        : args.supplier,
    }

    return updateSupplier.definition.url
            .replace('{supplier}', parsedArgs.supplier.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:110
* @route '/api/v1/suppliers/{supplier}'
*/
updateSupplier.patch = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateSupplier.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:110
* @route '/api/v1/suppliers/{supplier}'
*/
const updateSupplierForm = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateSupplier.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::updateSupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:110
* @route '/api/v1/suppliers/{supplier}'
*/
updateSupplierForm.patch = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateSupplier.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

updateSupplier.form = updateSupplierForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroySupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:125
* @route '/api/v1/suppliers/{supplier}'
*/
export const destroySupplier = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroySupplier.url(args, options),
    method: 'delete',
})

destroySupplier.definition = {
    methods: ["delete"],
    url: '/api/v1/suppliers/{supplier}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroySupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:125
* @route '/api/v1/suppliers/{supplier}'
*/
destroySupplier.url = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { supplier: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { supplier: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            supplier: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        supplier: typeof args.supplier === 'object'
        ? args.supplier.id
        : args.supplier,
    }

    return destroySupplier.definition.url
            .replace('{supplier}', parsedArgs.supplier.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroySupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:125
* @route '/api/v1/suppliers/{supplier}'
*/
destroySupplier.delete = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroySupplier.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroySupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:125
* @route '/api/v1/suppliers/{supplier}'
*/
const destroySupplierForm = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroySupplier.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::destroySupplier
* @see app/Http/Controllers/Api/V1/CatalogController.php:125
* @route '/api/v1/suppliers/{supplier}'
*/
destroySupplierForm.delete = (args: { supplier: string | number | { id: string | number } } | [supplier: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroySupplier.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroySupplier.form = destroySupplierForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
export const searchSuppliers = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: searchSuppliers.url(options),
    method: 'get',
})

searchSuppliers.definition = {
    methods: ["get","head"],
    url: '/api/v1/suppliers/search',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
searchSuppliers.url = (options?: RouteQueryOptions) => {
    return searchSuppliers.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
searchSuppliers.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: searchSuppliers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
searchSuppliers.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: searchSuppliers.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
const searchSuppliersForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchSuppliers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
searchSuppliersForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchSuppliers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::searchSuppliers
* @see app/Http/Controllers/Api/V1/CatalogController.php:133
* @route '/api/v1/suppliers/search'
*/
searchSuppliersForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchSuppliers.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

searchSuppliers.form = searchSuppliersForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
export const stockMovements = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: stockMovements.url(options),
    method: 'get',
})

stockMovements.definition = {
    methods: ["get","head"],
    url: '/api/v1/stock-movements',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
stockMovements.url = (options?: RouteQueryOptions) => {
    return stockMovements.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
stockMovements.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: stockMovements.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
stockMovements.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: stockMovements.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
const stockMovementsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: stockMovements.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
stockMovementsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: stockMovements.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::stockMovements
* @see app/Http/Controllers/Api/V1/CatalogController.php:146
* @route '/api/v1/stock-movements'
*/
stockMovementsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: stockMovements.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

stockMovements.form = stockMovementsForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:164
* @route '/api/v1/stock-movements'
*/
export const storeStockMovement = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeStockMovement.url(options),
    method: 'post',
})

storeStockMovement.definition = {
    methods: ["post"],
    url: '/api/v1/stock-movements',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:164
* @route '/api/v1/stock-movements'
*/
storeStockMovement.url = (options?: RouteQueryOptions) => {
    return storeStockMovement.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:164
* @route '/api/v1/stock-movements'
*/
storeStockMovement.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeStockMovement.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:164
* @route '/api/v1/stock-movements'
*/
const storeStockMovementForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeStockMovement.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::storeStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:164
* @route '/api/v1/stock-movements'
*/
storeStockMovementForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeStockMovement.url(options),
    method: 'post',
})

storeStockMovement.form = storeStockMovementForm

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
export const showStockMovement = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showStockMovement.url(args, options),
    method: 'get',
})

showStockMovement.definition = {
    methods: ["get","head"],
    url: '/api/v1/stock-movements/{movement}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
showStockMovement.url = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { movement: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { movement: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            movement: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        movement: typeof args.movement === 'object'
        ? args.movement.id
        : args.movement,
    }

    return showStockMovement.definition.url
            .replace('{movement}', parsedArgs.movement.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
showStockMovement.get = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showStockMovement.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
showStockMovement.head = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: showStockMovement.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
const showStockMovementForm = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showStockMovement.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
showStockMovementForm.get = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showStockMovement.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CatalogController::showStockMovement
* @see app/Http/Controllers/Api/V1/CatalogController.php:157
* @route '/api/v1/stock-movements/{movement}'
*/
showStockMovementForm.head = (args: { movement: string | number | { id: string | number } } | [movement: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showStockMovement.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

showStockMovement.form = showStockMovementForm

const CatalogController = { products, storeProduct, showProduct, updateProduct, destroyProduct, suppliers, storeSupplier, showSupplier, updateSupplier, destroySupplier, searchSuppliers, stockMovements, storeStockMovement, showStockMovement }

export default CatalogController