GitHub

DaffCartFacadeInterface

interface

import { DaffCartFacadeInterface } from '@daffodil/cart/state'

interface DaffCartFacadeInterface<T extends DaffCart = DaffCart, V extends DaffCartOrderResult = DaffCartOrderResult> {
  cart$: Observable<T>
  resolved$: Observable<DaffCartResolveState>
  loadingObject$: Observable<DaffCartLoading>
  featureLoading$: Observable<boolean>
  featureResolving$: Observable<boolean>
  featureMutating$: Observable<boolean>
  loading$: Observable<boolean>
  resolving$: Observable<boolean>
  mutating$: Observable<boolean>
  billingAddressLoading$: Observable<boolean>
  billingAddressResolving$: Observable<boolean>
  billingAddressMutating$: Observable<boolean>
  shippingAddressLoading$: Observable<boolean>
  shippingAddressResolving$: Observable<boolean>
  shippingAddressMutating$: Observable<boolean>
  shippingInformationLoading$: Observable<boolean>
  shippingInformationResolving$: Observable<boolean>
  shippingInformationMutating$: Observable<boolean>
  shippingMethodsLoading$: Observable<boolean>
  shippingMethodsResolving$: Observable<boolean>
  paymentLoading$: Observable<boolean>
  paymentResolving$: Observable<boolean>
  paymentMutating$: Observable<boolean>
  paymentMethodsLoading$: Observable<boolean>
  paymentMethodsResolving$: Observable<boolean>
  couponLoading$: Observable<boolean>
  couponResolving$: Observable<boolean>
  couponMutating$: Observable<boolean>
  itemLoading$: Observable<boolean>
  itemAdding$: Observable<boolean>
  itemResolving$: Observable<boolean>
  itemMutating$: Observable<boolean>
  errors$: Observable<DaffCartErrors>
  cartErrors$: Observable<DaffCartErrors[DaffCartOperationType.Cart]>
  itemErrors$: Observable<DaffCartErrors[DaffCartOperationType.Item]>
  billingAddressErrors$: Observable<DaffCartErrors[DaffCartOperationType.BillingAddress]>
  shippingAddressErrors$: Observable<DaffCartErrors[DaffCartOperationType.ShippingAddress]>
  shippingInformationErrors$: Observable<DaffCartErrors[DaffCartOperationType.ShippingInformation]>
  shippingMethodsErrors$: Observable<DaffCartErrors[DaffCartOperationType.ShippingMethods]>
  paymentErrors$: Observable<DaffCartErrors[DaffCartOperationType.Payment]>
  paymentMethodsErrors$: Observable<DaffCartErrors[DaffCartOperationType.PaymentMethods]>
  couponErrors$: Observable<DaffCartErrors[DaffCartOperationType.Coupon]>
  itemEntities$: Observable<DaffOperationEntity<T['items'][number]>[]>
  totalItems$: Observable<number>
  hasOutOfStockItems$: Observable<boolean>
  outOfStockItems$: Observable<DaffOperationEntity<T['items'][number]>[]>
  inStockItems$: Observable<DaffOperationEntity<T['items'][number]>[]>
  itemDictionary$: Observable<Dictionary<DaffOperationEntity<T['items'][number]>>>
  paymentId$: Observable<any>
  isCartEmpty$: Observable<boolean>
  isBillingSameAsShipping$: Observable<boolean>
  hasBillingAddress$: Observable<boolean>
  hasShippingAddress$: Observable<boolean>
  hasShippingMethod$: Observable<boolean>
  hasPaymentMethod$: Observable<boolean>
  canPlaceOrder$: Observable<boolean>
  orderResultLoading$: Observable<boolean>
  orderResultErrors$: Observable<DaffStateError[]>
  orderResult$: Observable<V>
  orderResultId$: Observable<V['orderId']>
  orderResultCartId$: Observable<V['cartId']>
  hasOrderResult$: Observable<boolean>

  getConfiguredCartItemAttributes(itemId: T["items"][number]["id"]): Observable<DaffConfigurableCartItemAttribute[]>
  getCompositeCartItemOptions(itemId: T["items"][number]["id"]): Observable<DaffCompositeCartItemOption[]>
  isCartItemOutOfStock(itemId: T["items"][number]["id"]): Observable<boolean>
}

Properties

cart$
Observable
resolved$
Observable<DaffCartResolveState>
loadingObject$
Observable<DaffCartLoading>

The object that holds all the loading states for cart operations.

featureLoading$
Observable

Whether there is any cart operation in progress. This includes operations specifically for cart subfields.

featureResolving$
Observable

Whether there is any cart resolve operation in progress. This includes operations for cart subfields. This pertains only to requests that do not mutate data such as "load" or "list".

featureMutating$
Observable

Whether there is any cart mutate operation in progress. This includes operations for cart subfields. This pertains only to requests that mutate data such as "update".

loading$
Observable

Whether there is a cart operation in progress. This does not include operations specifically for cart subfields.

resolving$
Observable

Whether there is a cart resolve operation in progress. This does not include operations specifically for cart subfields. This pertains only to requests that do not mutate data such as "load" or "list".

mutating$
Observable

Whether there is a cart mutate operation in progress. This does not include operations specifically for cart subfields. This pertains only to requests that mutate data such as "update".

billingAddressLoading$
Observable

Whether there is a cart billing address operation in progress.

billingAddressResolving$
Observable

Whether there is a cart billing address resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

billingAddressMutating$
Observable

Whether there is a cart billing address mutate operation in progress. This pertains only to requests that mutate data such as "update".

shippingAddressLoading$
Observable

Whether there is a cart shipping address operation in progress.

shippingAddressResolving$
Observable

Whether there is a cart shipping address resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

shippingAddressMutating$
Observable

Whether there is a cart shipping address mutate operation in progress. This pertains only to requests that mutate data such as "update".

shippingInformationLoading$
Observable

Whether there is a cart shipping information operation in progress.

shippingInformationResolving$
Observable

Whether there is a cart shipping information resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

shippingInformationMutating$
Observable

Whether there is a cart shipping information mutate operation in progress. This pertains only to requests that mutate data such as "update".

shippingMethodsLoading$
Observable

Whether there is a cart shipping methods operation in progress.

shippingMethodsResolving$
Observable

Whether there is a cart shipping methods resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

paymentLoading$
Observable

Whether there is a cart payment operation in progress.

paymentResolving$
Observable

Whether there is a cart payment resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

paymentMutating$
Observable

Whether there is a cart payment mutate operation in progress. This pertains only to requests that mutate data such as "update".

paymentMethodsLoading$
Observable

Whether there is a cart payment methods operation in progress.

paymentMethodsResolving$
Observable

Whether there is a cart payment methods resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

couponLoading$
Observable

Whether there is a cart coupon operation in progress.

couponResolving$
Observable

Whether there is a cart coupon resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

couponMutating$
Observable

Whether there is a cart coupon mutate operation in progress. This pertains only to requests that mutate data such as "update".

itemLoading$
Observable

Whether there is a cart item operation in progress.

itemAdding$
Observable

Whether there is a cart item add operation in progress.

itemResolving$
Observable

Whether there is a cart item resolve operation in progress. This pertains only to requests that do not mutate data such as "load" or "list".

itemMutating$
Observable

Whether there is a cart item mutate operation in progress. This pertains only to requests that mutate data such as "update".

errors$
Observable<DaffCartErrors>
cartErrors$
Observable<DaffCartErrors[DaffCartOperationType.Cart]>
itemErrors$
Observable<DaffCartErrors[DaffCartOperationType.Item]>
billingAddressErrors$
Observable<DaffCartErrors[DaffCartOperationType.BillingAddress]>
shippingAddressErrors$
Observable<DaffCartErrors[DaffCartOperationType.ShippingAddress]>
shippingInformationErrors$
Observable<DaffCartErrors[DaffCartOperationType.ShippingInformation]>
shippingMethodsErrors$
Observable<DaffCartErrors[DaffCartOperationType.ShippingMethods]>
paymentErrors$
Observable<DaffCartErrors[DaffCartOperationType.Payment]>
paymentMethodsErrors$
Observable<DaffCartErrors[DaffCartOperationType.PaymentMethods]>
couponErrors$
Observable<DaffCartErrors[DaffCartOperationType.Coupon]>
itemEntities$
Observable<DaffOperationEntity[]>

A list of the cart items.

totalItems$
Observable

The total number of cart items, taking into account the quantity of each cart item.

hasOutOfStockItems$
Observable
outOfStockItems$
Observable<DaffOperationEntity[]>

All cart items that are out of stock.

inStockItems$
Observable<DaffOperationEntity[]>

All cart items that are in stock.

itemDictionary$
ObservableDaffOperationEntity>>
paymentId$
Observable

The user-defined platform-agnostic payment identifier that corresponds to the cart's current (platform-specific) payment method. Define the mapping with the DaffCartPaymentMethodIdMap injection token.

isCartEmpty$
Observable
isBillingSameAsShipping$
Observable

Whether the cart's shipping address equals the billing address. Returns false if either address is null or undefined.

hasBillingAddress$
Observable
hasShippingAddress$
Observable
hasShippingMethod$
Observable
hasPaymentMethod$
Observable
canPlaceOrder$
Observable
orderResultLoading$
Observable
orderResultErrors$
Observable<DaffStateError[]>
orderResult$
Observable
orderResultId$
Observable
orderResultCartId$
Observable
hasOrderResult$
Observable

() Methods

getConfiguredCartItemAttributes
Observable<DaffConfigurableCartItemAttribute[]>
Parameters
ParameteritemId: T["items"][number]["id"]
Description
getCompositeCartItemOptions
Observable<DaffCompositeCartItemOption[]>
Parameters
ParameteritemId: T["items"][number]["id"]
Description
isCartItemOutOfStock
Observable
Parameters
ParameteritemId: T["items"][number]["id"]
Description