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
}
anyApply a coupon to the cart and return a partial of the cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
| Parameter | coupon: T["coupons"][number] |
|---|---|
| Description |
anyList coupon codes applied to a cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
anyRemove a coupon from the cart and return a partial of the cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
| Parameter | coupon: T["coupons"][number] |
|---|---|
| Description |
anyRemove all coupons from the cart and return a partial of the cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |