import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition } from './../../../wayfinder'
/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
export const invoices = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: invoices.url(options),
    method: 'get',
})

invoices.definition = {
    methods: ["get","head"],
    url: '/credit-notes/search/invoices',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
invoices.url = (options?: RouteQueryOptions) => {
    return invoices.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
invoices.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: invoices.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
invoices.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: invoices.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
const invoicesForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: invoices.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
invoicesForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: invoices.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\CreditNotesController::invoices
* @see app/Http/Controllers/CreditNotesController.php:357
* @route '/credit-notes/search/invoices'
*/
invoicesForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: invoices.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

invoices.form = invoicesForm

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/products'
*/
export const products = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: products.url(options),
    method: 'get',
})

products.definition = {
    methods: ["get","head"],
    url: '/credit-notes/search/products',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/products'
*/
products.url = (options?: RouteQueryOptions) => {
    return products.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/products'
*/
products.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: products.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/products'
*/
products.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: products.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/products'
*/
const productsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: products.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/products'
*/
productsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: products.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\CreditNotesController::products
* @see app/Http/Controllers/CreditNotesController.php:389
* @route '/credit-notes/search/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

const search = {
    invoices: Object.assign(invoices, invoices),
    products: Object.assign(products, products),
}

export default search