import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition } from './../../../wayfinder'
/**
* @see \App\Http\Controllers\Widget\CouponApplyController::__invoke
* @see app/Http/Controllers/Widget/CouponApplyController.php:30
* @route '/api/v1/widget/coupon/apply'
*/
export const apply = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: apply.url(options),
    method: 'post',
})

apply.definition = {
    methods: ["post"],
    url: '/api/v1/widget/coupon/apply',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Widget\CouponApplyController::__invoke
* @see app/Http/Controllers/Widget/CouponApplyController.php:30
* @route '/api/v1/widget/coupon/apply'
*/
apply.url = (options?: RouteQueryOptions) => {
    return apply.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Widget\CouponApplyController::__invoke
* @see app/Http/Controllers/Widget/CouponApplyController.php:30
* @route '/api/v1/widget/coupon/apply'
*/
apply.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: apply.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Widget\CouponApplyController::__invoke
* @see app/Http/Controllers/Widget/CouponApplyController.php:30
* @route '/api/v1/widget/coupon/apply'
*/
const applyForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: apply.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Widget\CouponApplyController::__invoke
* @see app/Http/Controllers/Widget/CouponApplyController.php:30
* @route '/api/v1/widget/coupon/apply'
*/
applyForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: apply.url(options),
    method: 'post',
})

apply.form = applyForm

const coupon = {
    apply: Object.assign(apply, apply),
}

export default coupon