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

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

/**
* @see \App\Http\Controllers\InvoicesController::pos
* @see app/Http/Controllers/InvoicesController.php:378
* @route '/invoices/pos'
*/
pos.url = (options?: RouteQueryOptions) => {
    return pos.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\InvoicesController::pos
* @see app/Http/Controllers/InvoicesController.php:378
* @route '/invoices/pos'
*/
pos.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: pos.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::pos
* @see app/Http/Controllers/InvoicesController.php:378
* @route '/invoices/pos'
*/
pos.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: pos.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\InvoicesController::pos
* @see app/Http/Controllers/InvoicesController.php:378
* @route '/invoices/pos'
*/
const posForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: pos.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::pos
* @see app/Http/Controllers/InvoicesController.php:378
* @route '/invoices/pos'
*/
posForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: pos.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::pos
* @see app/Http/Controllers/InvoicesController.php:378
* @route '/invoices/pos'
*/
posForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: pos.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

pos.form = posForm

/**
* @see \App\Http\Controllers\InvoicesController::storePos
* @see app/Http/Controllers/InvoicesController.php:426
* @route '/invoices/pos'
*/
export const storePos = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storePos.url(options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\InvoicesController::storePos
* @see app/Http/Controllers/InvoicesController.php:426
* @route '/invoices/pos'
*/
storePos.url = (options?: RouteQueryOptions) => {
    return storePos.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\InvoicesController::storePos
* @see app/Http/Controllers/InvoicesController.php:426
* @route '/invoices/pos'
*/
storePos.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storePos.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::storePos
* @see app/Http/Controllers/InvoicesController.php:426
* @route '/invoices/pos'
*/
const storePosForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storePos.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::storePos
* @see app/Http/Controllers/InvoicesController.php:426
* @route '/invoices/pos'
*/
storePosForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storePos.url(options),
    method: 'post',
})

storePos.form = storePosForm

/**
* @see \App\Http\Controllers\InvoicesController::index
* @see app/Http/Controllers/InvoicesController.php:44
* @route '/invoices'
*/
export const index = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

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

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

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

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

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

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

/**
* @see \App\Http\Controllers\InvoicesController::index
* @see app/Http/Controllers/InvoicesController.php:44
* @route '/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\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
export const create = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
create.url = (options?: RouteQueryOptions) => {
    return create.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
create.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
create.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: create.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
const createForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
createForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::create
* @see app/Http/Controllers/InvoicesController.php:217
* @route '/invoices/create'
*/
createForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

create.form = createForm

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

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

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

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

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

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

store.form = storeForm

/**
* @see \App\Http\Controllers\InvoicesController::storeRecurring
* @see app/Http/Controllers/InvoicesController.php:1282
* @route '/invoices/recurring'
*/
export const storeRecurring = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeRecurring.url(options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\InvoicesController::storeRecurring
* @see app/Http/Controllers/InvoicesController.php:1282
* @route '/invoices/recurring'
*/
storeRecurring.url = (options?: RouteQueryOptions) => {
    return storeRecurring.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\InvoicesController::storeRecurring
* @see app/Http/Controllers/InvoicesController.php:1282
* @route '/invoices/recurring'
*/
storeRecurring.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeRecurring.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::storeRecurring
* @see app/Http/Controllers/InvoicesController.php:1282
* @route '/invoices/recurring'
*/
const storeRecurringForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeRecurring.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::storeRecurring
* @see app/Http/Controllers/InvoicesController.php:1282
* @route '/invoices/recurring'
*/
storeRecurringForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeRecurring.url(options),
    method: 'post',
})

storeRecurring.form = storeRecurringForm

/**
* @see \App\Http\Controllers\InvoicesController::destroyRecurring
* @see app/Http/Controllers/InvoicesController.php:1313
* @route '/invoices/recurring/{recurringDocument}'
*/
export const destroyRecurring = (args: { recurringDocument: string | number } | [recurringDocument: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyRecurring.url(args, options),
    method: 'delete',
})

destroyRecurring.definition = {
    methods: ["delete"],
    url: '/invoices/recurring/{recurringDocument}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\InvoicesController::destroyRecurring
* @see app/Http/Controllers/InvoicesController.php:1313
* @route '/invoices/recurring/{recurringDocument}'
*/
destroyRecurring.url = (args: { recurringDocument: string | number } | [recurringDocument: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { recurringDocument: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        recurringDocument: args.recurringDocument,
    }

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

/**
* @see \App\Http\Controllers\InvoicesController::destroyRecurring
* @see app/Http/Controllers/InvoicesController.php:1313
* @route '/invoices/recurring/{recurringDocument}'
*/
destroyRecurring.delete = (args: { recurringDocument: string | number } | [recurringDocument: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyRecurring.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\InvoicesController::destroyRecurring
* @see app/Http/Controllers/InvoicesController.php:1313
* @route '/invoices/recurring/{recurringDocument}'
*/
const destroyRecurringForm = (args: { recurringDocument: string | number } | [recurringDocument: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyRecurring.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::destroyRecurring
* @see app/Http/Controllers/InvoicesController.php:1313
* @route '/invoices/recurring/{recurringDocument}'
*/
destroyRecurringForm.delete = (args: { recurringDocument: string | number } | [recurringDocument: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyRecurring.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroyRecurring.form = destroyRecurringForm

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

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

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

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

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

    args = applyUrlDefaults(args)

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

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

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

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

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

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

/**
* @see \App\Http\Controllers\InvoicesController::show
* @see app/Http/Controllers/InvoicesController.php:688
* @route '/invoices/{invoice}'
*/
showForm.head = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: 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\InvoicesController::edit
* @see app/Http/Controllers/InvoicesController.php:776
* @route '/invoices/{invoice}/edit'
*/
export const edit = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\InvoicesController::edit
* @see app/Http/Controllers/InvoicesController.php:776
* @route '/invoices/{invoice}/edit'
*/
edit.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

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

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

/**
* @see \App\Http\Controllers\InvoicesController::edit
* @see app/Http/Controllers/InvoicesController.php:776
* @route '/invoices/{invoice}/edit'
*/
const editForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::edit
* @see app/Http/Controllers/InvoicesController.php:776
* @route '/invoices/{invoice}/edit'
*/
editForm.get = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::edit
* @see app/Http/Controllers/InvoicesController.php:776
* @route '/invoices/{invoice}/edit'
*/
editForm.head = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

edit.form = editForm

/**
* @see \App\Http\Controllers\InvoicesController::update
* @see app/Http/Controllers/InvoicesController.php:866
* @route '/invoices/{invoice}'
*/
export const update = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

update.definition = {
    methods: ["put"],
    url: '/invoices/{invoice}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\InvoicesController::update
* @see app/Http/Controllers/InvoicesController.php:866
* @route '/invoices/{invoice}'
*/
update.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InvoicesController::update
* @see app/Http/Controllers/InvoicesController.php:866
* @route '/invoices/{invoice}'
*/
update.put = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

/**
* @see \App\Http\Controllers\InvoicesController::update
* @see app/Http/Controllers/InvoicesController.php:866
* @route '/invoices/{invoice}'
*/
const updateForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::update
* @see app/Http/Controllers/InvoicesController.php:866
* @route '/invoices/{invoice}'
*/
updateForm.put = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

update.form = updateForm

/**
* @see \App\Http\Controllers\InvoicesController::destroy
* @see app/Http/Controllers/InvoicesController.php:891
* @route '/invoices/{invoice}'
*/
export const destroy = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

destroy.definition = {
    methods: ["delete"],
    url: '/invoices/{invoice}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\InvoicesController::destroy
* @see app/Http/Controllers/InvoicesController.php:891
* @route '/invoices/{invoice}'
*/
destroy.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InvoicesController::destroy
* @see app/Http/Controllers/InvoicesController.php:891
* @route '/invoices/{invoice}'
*/
destroy.delete = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\InvoicesController::destroy
* @see app/Http/Controllers/InvoicesController.php:891
* @route '/invoices/{invoice}'
*/
const destroyForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::destroy
* @see app/Http/Controllers/InvoicesController.php:891
* @route '/invoices/{invoice}'
*/
destroyForm.delete = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroy.form = destroyForm

/**
* @see \App\Http\Controllers\InvoicesController::updateStatus
* @see app/Http/Controllers/InvoicesController.php:945
* @route '/invoices/{invoice}/status'
*/
export const updateStatus = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateStatus.url(args, options),
    method: 'patch',
})

updateStatus.definition = {
    methods: ["patch"],
    url: '/invoices/{invoice}/status',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\InvoicesController::updateStatus
* @see app/Http/Controllers/InvoicesController.php:945
* @route '/invoices/{invoice}/status'
*/
updateStatus.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InvoicesController::updateStatus
* @see app/Http/Controllers/InvoicesController.php:945
* @route '/invoices/{invoice}/status'
*/
updateStatus.patch = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateStatus.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\InvoicesController::updateStatus
* @see app/Http/Controllers/InvoicesController.php:945
* @route '/invoices/{invoice}/status'
*/
const updateStatusForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateStatus.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::updateStatus
* @see app/Http/Controllers/InvoicesController.php:945
* @route '/invoices/{invoice}/status'
*/
updateStatusForm.patch = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateStatus.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

updateStatus.form = updateStatusForm

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

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

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

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

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

    args = applyUrlDefaults(args)

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

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

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

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

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

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

/**
* @see \App\Http\Controllers\InvoicesController::downloadPdf
* @see app/Http/Controllers/InvoicesController.php:1019
* @route '/invoices/{invoice}/download-pdf'
*/
downloadPdfForm.head = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: 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

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
export const printPdf = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: printPdf.url(args, options),
    method: 'get',
})

printPdf.definition = {
    methods: ["get","head"],
    url: '/invoices/{invoice}/print-pdf',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
printPdf.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
printPdf.get = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: printPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
printPdf.head = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: printPdf.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
const printPdfForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: printPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
printPdfForm.get = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: printPdf.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\InvoicesController::printPdf
* @see app/Http/Controllers/InvoicesController.php:1063
* @route '/invoices/{invoice}/print-pdf'
*/
printPdfForm.head = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: printPdf.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

printPdf.form = printPdfForm

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

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

/**
* @see \App\Http\Controllers\InvoicesController::email
* @see app/Http/Controllers/InvoicesController.php:1102
* @route '/invoices/{invoice}/email'
*/
email.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

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

/**
* @see \App\Http\Controllers\InvoicesController::email
* @see app/Http/Controllers/InvoicesController.php:1102
* @route '/invoices/{invoice}/email'
*/
const emailForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: email.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::email
* @see app/Http/Controllers/InvoicesController.php:1102
* @route '/invoices/{invoice}/email'
*/
emailForm.post = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: email.url(args, options),
    method: 'post',
})

email.form = emailForm

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

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

/**
* @see \App\Http\Controllers\InvoicesController::sign
* @see app/Http/Controllers/InvoicesController.php:1216
* @route '/invoices/{invoice}/sign'
*/
sign.url = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { invoice: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

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

/**
* @see \App\Http\Controllers\InvoicesController::sign
* @see app/Http/Controllers/InvoicesController.php:1216
* @route '/invoices/{invoice}/sign'
*/
const signForm = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sign.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\InvoicesController::sign
* @see app/Http/Controllers/InvoicesController.php:1216
* @route '/invoices/{invoice}/sign'
*/
signForm.post = (args: { invoice: string | number | { id: string | number } } | [invoice: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sign.url(args, options),
    method: 'post',
})

sign.form = signForm

const InvoicesController = { pos, storePos, index, create, store, storeRecurring, destroyRecurring, show, edit, update, destroy, updateStatus, downloadPdf, printPdf, email, sign }

export default InvoicesController