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

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::index
* @see app/Http/Controllers/Api/InvoiceController.php:31
* @route '/api/invoices'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\InvoiceController::index
* @see app/Http/Controllers/Api/InvoiceController.php:31
* @route '/api/invoices'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::index
* @see app/Http/Controllers/Api/InvoiceController.php:31
* @route '/api/invoices'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::index
* @see app/Http/Controllers/Api/InvoiceController.php:31
* @route '/api/invoices'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::index
* @see app/Http/Controllers/Api/InvoiceController.php:31
* @route '/api/invoices'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::index
* @see app/Http/Controllers/Api/InvoiceController.php:31
* @route '/api/invoices'
*/
indexForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

index.form = indexForm

/**
* @see \App\Http\Controllers\Api\InvoiceController::store
* @see app/Http/Controllers/Api/InvoiceController.php:68
* @route '/api/invoices'
*/
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::store
* @see app/Http/Controllers/Api/InvoiceController.php:68
* @route '/api/invoices'
*/
store.url = (options?: RouteQueryOptions) => {
    return store.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\InvoiceController::store
* @see app/Http/Controllers/Api/InvoiceController.php:68
* @route '/api/invoices'
*/
store.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::store
* @see app/Http/Controllers/Api/InvoiceController.php:68
* @route '/api/invoices'
*/
const storeForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::store
* @see app/Http/Controllers/Api/InvoiceController.php:68
* @route '/api/invoices'
*/
storeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

store.form = storeForm

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
export const checkOverdue = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: checkOverdue.url(options),
    method: 'get',
})

checkOverdue.definition = {
    methods: ["get","head"],
    url: '/api/invoices/check-overdue',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
checkOverdue.url = (options?: RouteQueryOptions) => {
    return checkOverdue.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
checkOverdue.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: checkOverdue.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
checkOverdue.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: checkOverdue.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
const checkOverdueForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: checkOverdue.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
checkOverdueForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: checkOverdue.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::checkOverdue
* @see app/Http/Controllers/Api/InvoiceController.php:223
* @route '/api/invoices/check-overdue'
*/
checkOverdueForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: checkOverdue.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

checkOverdue.form = checkOverdueForm

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
export const show = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
show.url = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { id: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        id: args.id,
    }

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
show.get = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
show.head = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
const showForm = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
showForm.get = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::show
* @see app/Http/Controllers/Api/InvoiceController.php:54
* @route '/api/invoices/{id}'
*/
showForm.head = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

show.form = showForm

/**
* @see \App\Http\Controllers\Api\InvoiceController::markPaid
* @see app/Http/Controllers/Api/InvoiceController.php:119
* @route '/api/invoices/{id}/mark-paid'
*/
export const markPaid = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: markPaid.url(args, options),
    method: 'post',
})

markPaid.definition = {
    methods: ["post"],
    url: '/api/invoices/{id}/mark-paid',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\InvoiceController::markPaid
* @see app/Http/Controllers/Api/InvoiceController.php:119
* @route '/api/invoices/{id}/mark-paid'
*/
markPaid.url = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { id: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        id: args.id,
    }

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::markPaid
* @see app/Http/Controllers/Api/InvoiceController.php:119
* @route '/api/invoices/{id}/mark-paid'
*/
markPaid.post = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: markPaid.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::markPaid
* @see app/Http/Controllers/Api/InvoiceController.php:119
* @route '/api/invoices/{id}/mark-paid'
*/
const markPaidForm = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: markPaid.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::markPaid
* @see app/Http/Controllers/Api/InvoiceController.php:119
* @route '/api/invoices/{id}/mark-paid'
*/
markPaidForm.post = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: markPaid.url(args, options),
    method: 'post',
})

markPaid.form = markPaidForm

/**
* @see \App\Http\Controllers\Api\InvoiceController::send
* @see app/Http/Controllers/Api/InvoiceController.php:162
* @route '/api/invoices/{id}/send'
*/
export const send = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: send.url(args, options),
    method: 'post',
})

send.definition = {
    methods: ["post"],
    url: '/api/invoices/{id}/send',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\InvoiceController::send
* @see app/Http/Controllers/Api/InvoiceController.php:162
* @route '/api/invoices/{id}/send'
*/
send.url = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { id: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        id: args.id,
    }

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::send
* @see app/Http/Controllers/Api/InvoiceController.php:162
* @route '/api/invoices/{id}/send'
*/
send.post = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: send.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::send
* @see app/Http/Controllers/Api/InvoiceController.php:162
* @route '/api/invoices/{id}/send'
*/
const sendForm = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: send.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::send
* @see app/Http/Controllers/Api/InvoiceController.php:162
* @route '/api/invoices/{id}/send'
*/
sendForm.post = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: send.url(args, options),
    method: 'post',
})

send.form = sendForm

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
export const downloadPdf = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: downloadPdf.url(args, options),
    method: 'get',
})

downloadPdf.definition = {
    methods: ["get","head"],
    url: '/api/invoices/{id}/pdf',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
downloadPdf.url = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { id: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        id: args.id,
    }

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

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
downloadPdf.get = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: downloadPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
downloadPdf.head = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: downloadPdf.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
const downloadPdfForm = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: downloadPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
downloadPdfForm.get = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: downloadPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\InvoiceController::downloadPdf
* @see app/Http/Controllers/Api/InvoiceController.php:194
* @route '/api/invoices/{id}/pdf'
*/
downloadPdfForm.head = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: downloadPdf.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

downloadPdf.form = downloadPdfForm

const InvoiceController = { index, store, checkOverdue, show, markPaid, send, downloadPdf }

export default InvoiceController