GitHub

MockDaffOrderFacade

Facade

import { MockDaffOrderFacade } from '@daffodil/order/state/testing'

@Injectable()
class MockDaffOrderFacade implements DaffOrderFacadeInterface {
  loading$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(null)
  errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject<DaffStateError[]>([])
  loadingState$: BehaviorSubject<DaffState> = new BehaviorSubject<DaffState>(DaffState.Stable)
  resolving$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)
  mutating$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)
  hasErrors$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)
  orders$: BehaviorSubject<DaffOrder[]> = new BehaviorSubject([])
  orderIds$: BehaviorSubject<DaffOrder['id'][]> = new BehaviorSubject([])
  orderCount$: BehaviorSubject<number> = new BehaviorSubject(null)
  orderEntities$: BehaviorSubject<Dictionary<DaffOrder>> = new BehaviorSubject({})
  placedOrder$: BehaviorSubject<DaffOrder> = new BehaviorSubject(null)
  hasPlacedOrder$: BehaviorSubject<boolean> = new BehaviorSubject(false)

  getOrder$(orderId: string): any
  getTotals$(orderId: string): any
  getAppliedCodes$(orderId: string): any
  getItems$(orderId: string): any
  getBillingAddresses$(orderId: string): any
  getShippingAddresses$(orderId: string): any
  getShipments$(orderId: string): any
  getPayment$(orderId: string): any
  getInvoices$(orderId: string): any
  getCredits$(orderId: string): any
  getGrandTotal$(orderId: string): any
  getSubtotal$(orderId: string): any
  getShippingTotal$(orderId: string): any
  getDiscountTotal$(orderId: string): any
  hasDiscount$(orderId: string): any
  getTaxTotal$(orderId: string): any
  dispatch(action: Action<string>): void
}

() Methods

getOrder$
any
Parameters
ParameterorderId: string
Description
getTotals$
any
Parameters
ParameterorderId: string
Description
getAppliedCodes$
any
Parameters
ParameterorderId: string
Description
getItems$
any
Parameters
ParameterorderId: string
Description
getBillingAddresses$
any
Parameters
ParameterorderId: string
Description
getShippingAddresses$
any
Parameters
ParameterorderId: string
Description
getShipments$
any
Parameters
ParameterorderId: string
Description
getPayment$
any
Parameters
ParameterorderId: string
Description
getInvoices$
any
Parameters
ParameterorderId: string
Description
getCredits$
any
Parameters
ParameterorderId: string
Description
getGrandTotal$
any

The specified order's grand total.

Parameters
ParameterorderId: string
Description
getSubtotal$
any

The specified order's subtotal.

Parameters
ParameterorderId: string
Description
getShippingTotal$
any

The specified order's shipping total.

Parameters
ParameterorderId: string
Description
getDiscountTotal$
any

The specified order's discount total.

Parameters
ParameterorderId: string
Description
hasDiscount$
any

Whether the specified order has a discount.

Parameters
ParameterorderId: string
Description
getTaxTotal$
any

The specified order's tax total.

Parameters
ParameterorderId: string
Description
dispatch
void
Parameters
Parameteraction: Action
Description