GitHub

DaffInMemoryCartCouponService

import { DaffInMemoryCartCouponService } from '@daffodil/cart/driver/in-memory'

@Injectable()
class DaffInMemoryCartCouponService extends DaffInMemoryDriverBase implements DaffCartCouponServiceInterface {
  list(cartId: string): Observable<DaffCartCoupon[]>
  apply(
    cartId: string
    coupon: DaffCartCoupon
  ): Observable<Partial<DaffCart>>
  remove(
    cartId: string
    coupon: DaffCartCoupon
  ): Observable<Partial<DaffCart>>
  removeAll(cartId: string): Observable<Partial<DaffCart>>
}

() Methods

list
Observable<DaffCartCoupon[]>

List coupon codes applied to a cart.

Parameters
ParametercartId: string
Description
apply
Observable<Partial<DaffCart>>

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

Parameters
ParametercartId: string
Description
Parametercoupon: DaffCartCoupon
Description
remove
Observable<Partial<DaffCart>>

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

Parameters
ParametercartId: string
Description
Parametercoupon: DaffCartCoupon
Description
removeAll
Observable<Partial<DaffCart>>

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

Parameters
ParametercartId: string
Description