GitHub

DaffCartCouponServiceInterface

Type

import { DaffCartCouponServiceInterface } from '@daffodil/cart/driver'

The interface responsible for applying a coupon to a cart.

interface DaffCartCouponServiceInterface<T extends DaffCart = DaffCart> {
  apply(
    cartId: T["id"]
    coupon: T["coupons"][number]
  ): any
  list(cartId: T["id"]): any
  remove(
    cartId: T["id"]
    coupon: T["coupons"][number]
  ): any
  removeAll(cartId: T["id"]): any
}

() Methods

apply
any

Apply a coupon to the cart and return a partial of the cart.

Parameters
ParametercartId: T["id"]
Description
Parametercoupon: T["coupons"][number]
Description
list
any

List coupon codes applied to a cart.

Parameters
ParametercartId: T["id"]
Description
remove
any

Remove a coupon from the cart and return a partial of the cart.

Parameters
ParametercartId: T["id"]
Description
Parametercoupon: T["coupons"][number]
Description
removeAll
any

Remove all coupons from the cart and return a partial of the cart.

Parameters
ParametercartId: T["id"]
Description