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