import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../wayfinder'
/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
export const create = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
create.url = (options?: RouteQueryOptions) => {
    return create.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
create.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
create.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: create.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
const createForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
createForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::create
* @see app/Http/Controllers/UspaOperationController.php:51
* @route '/i-uspa-decisions'
*/
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\UspaOperationController::store
* @see app/Http/Controllers/UspaOperationController.php:91
* @route '/i-uspa-decisions'
*/
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\UspaOperationController::store
* @see app/Http/Controllers/UspaOperationController.php:91
* @route '/i-uspa-decisions'
*/
store.url = (options?: RouteQueryOptions) => {
    return store.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UspaOperationController::store
* @see app/Http/Controllers/UspaOperationController.php:91
* @route '/i-uspa-decisions'
*/
store.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UspaOperationController::store
* @see app/Http/Controllers/UspaOperationController.php:91
* @route '/i-uspa-decisions'
*/
const storeForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UspaOperationController::store
* @see app/Http/Controllers/UspaOperationController.php:91
* @route '/i-uspa-decisions'
*/
storeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

store.form = storeForm

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
export const FuFinals = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: FuFinals.url(options),
    method: 'get',
})

FuFinals.definition = {
    methods: ["get","head"],
    url: '/i-uspa-decisions/fu-finals',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
FuFinals.url = (options?: RouteQueryOptions) => {
    return FuFinals.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
FuFinals.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: FuFinals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
FuFinals.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: FuFinals.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
const FuFinalsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: FuFinals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
FuFinalsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: FuFinals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::FuFinals
* @see app/Http/Controllers/UspaOperationController.php:308
* @route '/i-uspa-decisions/fu-finals'
*/
FuFinalsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: FuFinals.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

FuFinals.form = FuFinalsForm

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
export const NfrFinals = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: NfrFinals.url(options),
    method: 'get',
})

NfrFinals.definition = {
    methods: ["get","head"],
    url: '/i-uspa-decisions/nfr-finals',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
NfrFinals.url = (options?: RouteQueryOptions) => {
    return NfrFinals.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
NfrFinals.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: NfrFinals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
NfrFinals.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: NfrFinals.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
const NfrFinalsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: NfrFinals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
NfrFinalsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: NfrFinals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::NfrFinals
* @see app/Http/Controllers/UspaOperationController.php:335
* @route '/i-uspa-decisions/nfr-finals'
*/
NfrFinalsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: NfrFinals.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

NfrFinals.form = NfrFinalsForm

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
export const MyVotes = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: MyVotes.url(options),
    method: 'get',
})

MyVotes.definition = {
    methods: ["get","head"],
    url: '/i-uspa-decisions/my-votes',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
MyVotes.url = (options?: RouteQueryOptions) => {
    return MyVotes.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
MyVotes.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: MyVotes.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
MyVotes.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: MyVotes.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
const MyVotesForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: MyVotes.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
MyVotesForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: MyVotes.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::MyVotes
* @see app/Http/Controllers/UspaOperationController.php:0
* @route '/i-uspa-decisions/my-votes'
*/
MyVotesForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: MyVotes.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

MyVotes.form = MyVotesForm

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
export const EditStatus = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: EditStatus.url(options),
    method: 'get',
})

EditStatus.definition = {
    methods: ["get","head"],
    url: '/i-uspa-decisions/change-status',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
EditStatus.url = (options?: RouteQueryOptions) => {
    return EditStatus.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
EditStatus.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: EditStatus.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
EditStatus.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: EditStatus.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
const EditStatusForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: EditStatus.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
EditStatusForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: EditStatus.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UspaOperationController::EditStatus
* @see app/Http/Controllers/UspaOperationController.php:179
* @route '/i-uspa-decisions/change-status'
*/
EditStatusForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: EditStatus.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

EditStatus.form = EditStatusForm

/**
* @see \App\Http\Controllers\UspaOperationController::UpdateStatus
* @see app/Http/Controllers/UspaOperationController.php:197
* @route '/i-uspa-decisions/change-status/{project}'
*/
export const UpdateStatus = (args: { project: number | { id: number } } | [project: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: UpdateStatus.url(args, options),
    method: 'put',
})

UpdateStatus.definition = {
    methods: ["put"],
    url: '/i-uspa-decisions/change-status/{project}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\UspaOperationController::UpdateStatus
* @see app/Http/Controllers/UspaOperationController.php:197
* @route '/i-uspa-decisions/change-status/{project}'
*/
UpdateStatus.url = (args: { project: number | { id: number } } | [project: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { project: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\UspaOperationController::UpdateStatus
* @see app/Http/Controllers/UspaOperationController.php:197
* @route '/i-uspa-decisions/change-status/{project}'
*/
UpdateStatus.put = (args: { project: number | { id: number } } | [project: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: UpdateStatus.url(args, options),
    method: 'put',
})

/**
* @see \App\Http\Controllers\UspaOperationController::UpdateStatus
* @see app/Http/Controllers/UspaOperationController.php:197
* @route '/i-uspa-decisions/change-status/{project}'
*/
const UpdateStatusForm = (args: { project: number | { id: number } } | [project: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: UpdateStatus.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UspaOperationController::UpdateStatus
* @see app/Http/Controllers/UspaOperationController.php:197
* @route '/i-uspa-decisions/change-status/{project}'
*/
UpdateStatusForm.put = (args: { project: number | { id: number } } | [project: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: UpdateStatus.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

UpdateStatus.form = UpdateStatusForm

/**
* @see \App\Http\Controllers\UspaOperationController::calculate
* @see app/Http/Controllers/UspaOperationController.php:235
* @route '/i-uspa-decisions/calculate/{projectId}'
*/
export const calculate = (args: { projectId: string | number } | [projectId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: calculate.url(args, options),
    method: 'post',
})

calculate.definition = {
    methods: ["post"],
    url: '/i-uspa-decisions/calculate/{projectId}',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\UspaOperationController::calculate
* @see app/Http/Controllers/UspaOperationController.php:235
* @route '/i-uspa-decisions/calculate/{projectId}'
*/
calculate.url = (args: { projectId: string | number } | [projectId: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { projectId: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        projectId: args.projectId,
    }

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

/**
* @see \App\Http\Controllers\UspaOperationController::calculate
* @see app/Http/Controllers/UspaOperationController.php:235
* @route '/i-uspa-decisions/calculate/{projectId}'
*/
calculate.post = (args: { projectId: string | number } | [projectId: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: calculate.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UspaOperationController::calculate
* @see app/Http/Controllers/UspaOperationController.php:235
* @route '/i-uspa-decisions/calculate/{projectId}'
*/
const calculateForm = (args: { projectId: string | number } | [projectId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: calculate.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UspaOperationController::calculate
* @see app/Http/Controllers/UspaOperationController.php:235
* @route '/i-uspa-decisions/calculate/{projectId}'
*/
calculateForm.post = (args: { projectId: string | number } | [projectId: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: calculate.url(args, options),
    method: 'post',
})

calculate.form = calculateForm

const UspaOperationController = { create, store, FuFinals, NfrFinals, MyVotes, EditStatus, UpdateStatus, calculate }

export default UspaOperationController