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

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

/**
* @see \App\Http\Controllers\Admin\AdminKycReviewController::detail
* @see app/Http/Controllers/Admin/AdminKycReviewController.php:39
* @route '/admin/verificacion-kyc/usuarios/{user}'
*/
detail.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 detail.definition.url
            .replace('{user}', parsedArgs.user.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

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

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

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

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

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

detail.form = detailForm

/**
* @see \App\Http\Controllers\Admin\AdminKycDocumentDownloadController::__invoke
* @see app/Http/Controllers/Admin/AdminKycDocumentDownloadController.php:18
* @route '/admin/verificacion-kyc/usuarios/{user}/archivos/{document}'
*/
export const documentDownload = (args: { user: number | { id: number }, document: string | number } | [user: number | { id: number }, document: string | number ], options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: documentDownload.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Admin\AdminKycDocumentDownloadController::__invoke
* @see app/Http/Controllers/Admin/AdminKycDocumentDownloadController.php:18
* @route '/admin/verificacion-kyc/usuarios/{user}/archivos/{document}'
*/
documentDownload.url = (args: { user: number | { id: number }, document: string | number } | [user: number | { id: number }, document: string | number ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
            user: args[0],
            document: args[1],
        }
    }

    args = applyUrlDefaults(args)

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

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

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

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

/**
* @see \App\Http\Controllers\Admin\AdminKycDocumentDownloadController::__invoke
* @see app/Http/Controllers/Admin/AdminKycDocumentDownloadController.php:18
* @route '/admin/verificacion-kyc/usuarios/{user}/archivos/{document}'
*/
const documentDownloadForm = (args: { user: number | { id: number }, document: string | number } | [user: number | { id: number }, document: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: documentDownload.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminKycDocumentDownloadController::__invoke
* @see app/Http/Controllers/Admin/AdminKycDocumentDownloadController.php:18
* @route '/admin/verificacion-kyc/usuarios/{user}/archivos/{document}'
*/
documentDownloadForm.get = (args: { user: number | { id: number }, document: string | number } | [user: number | { id: number }, document: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: documentDownload.url(args, options),
    method: 'get',
})

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

documentDownload.form = documentDownloadForm

/**
* @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 kyc = {
    index: Object.assign(index, index),
    detail: Object.assign(detail, detail),
    documentDownload: Object.assign(documentDownload, documentDownload),
    approve: Object.assign(approve, approve),
    reject: Object.assign(reject, reject),
}

export default kyc