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]
): Observable<Partial<T>>
list(cartId: T["id"]): Observable<T['coupons']>
remove(
cartId: T["id"]
coupon: T["coupons"][number]
): Observable<Partial<T>>
removeAll(cartId: T["id"]): Observable<Partial<T>>
}
Observable> Apply a coupon to the cart and return a partial of the cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
| Parameter | coupon: T["coupons"][number] |
|---|---|
| Description |
ObservableList coupon codes applied to a cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
Observable> Remove a coupon from the cart and return a partial of the cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
| Parameter | coupon: T["coupons"][number] |
|---|---|
| Description |
Observable> Remove all coupons from the cart and return a partial of the cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |