import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../../wayfinder'
/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
export const index = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::index
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:15
* @route '/admin/verificacion-kyc'
*/
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\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
export const showSubmission = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showSubmission.url(args, options),
    method: 'get',
})

showSubmission.definition = {
    methods: ["get","head"],
    url: '/admin/verificacion-kyc/usuarios/{user}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
showSubmission.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
showSubmission.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showSubmission.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
showSubmission.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: showSubmission.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
const showSubmissionForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showSubmission.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
showSubmissionForm.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showSubmission.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::showSubmission
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
showSubmissionForm.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showSubmission.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

showSubmission.form = showSubmissionForm

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::approve
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:81
* @route '/admin/verificacion-kyc/usuarios/{user}/aprobar'
*/
export const approve = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: approve.url(args, options),
    method: 'patch',
})

approve.definition = {
    methods: ["patch"],
    url: '/admin/verificacion-kyc/usuarios/{user}/aprobar',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::approve
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:81
* @route '/admin/verificacion-kyc/usuarios/{user}/aprobar'
*/
approve.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::approve
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:81
* @route '/admin/verificacion-kyc/usuarios/{user}/aprobar'
*/
approve.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: approve.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::approve
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:81
* @route '/admin/verificacion-kyc/usuarios/{user}/aprobar'
*/
const approveForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: approve.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::approve
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:81
* @route '/admin/verificacion-kyc/usuarios/{user}/aprobar'
*/
approveForm.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: approve.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

approve.form = approveForm

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::reject
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:109
* @route '/admin/verificacion-kyc/usuarios/{user}/rechazar'
*/
export const reject = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: reject.url(args, options),
    method: 'patch',
})

reject.definition = {
    methods: ["patch"],
    url: '/admin/verificacion-kyc/usuarios/{user}/rechazar',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::reject
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:109
* @route '/admin/verificacion-kyc/usuarios/{user}/rechazar'
*/
reject.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::reject
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:109
* @route '/admin/verificacion-kyc/usuarios/{user}/rechazar'
*/
reject.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: reject.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::reject
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:109
* @route '/admin/verificacion-kyc/usuarios/{user}/rechazar'
*/
const rejectForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: reject.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::reject
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:109
* @route '/admin/verificacion-kyc/usuarios/{user}/rechazar'
*/
rejectForm.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: reject.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

reject.form = rejectForm

const AdminKycReviewController = { index, showSubmission, approve, reject }

export default AdminKycReviewController