GitHub

MockDaffOrderFacade

import { MockDaffOrderFacade } from '@daffodil/order/state/testing'
@Injectable()
class MockDaffOrderFacade implements DaffOrderFacadeInterface {
  loading$: BehaviorSubject<boolean>
  errors$: BehaviorSubject<DaffStateError[]>
  loadingState$: BehaviorSubject<DaffState>
  resolving$: BehaviorSubject<boolean>
  mutating$: BehaviorSubject<boolean>
  hasErrors$: BehaviorSubject<boolean>
  orders$: BehaviorSubject<DaffOrder[]>
  orderIds$: BehaviorSubject<DaffOrder['id'][]>
  orderCount$: BehaviorSubject<number>
  orderEntities$: BehaviorSubject<Dictionary<DaffOrder>>
  placedOrder$: BehaviorSubject<DaffOrder>
  hasPlacedOrder$: BehaviorSubject<boolean>
  getOrder$(orderId: string): BehaviorSubject<DaffOrder>
  getTotals$(orderId: string): BehaviorSubject<DaffOrder['totals']>
  getAppliedCodes$(orderId: string): BehaviorSubject<DaffOrder['applied_codes']>
  getItems$(orderId: string): BehaviorSubject<DaffOrder['items']>
  getBillingAddresses$(orderId: string): BehaviorSubject<DaffOrder['billing_addresses']>
  getShippingAddresses$(orderId: string): BehaviorSubject<DaffOrder['shipping_addresses']>
  getShipments$(orderId: string): BehaviorSubject<DaffOrder['shipments']>
  getPayment$(orderId: string): BehaviorSubject<DaffOrder['payment']>
  getInvoices$(orderId: string): BehaviorSubject<DaffOrder['invoices']>
  getCredits$(orderId: string): BehaviorSubject<DaffOrder['credits']>
  getGrandTotal$(orderId: string): BehaviorSubject<DaffOrderTotal>
  getSubtotal$(orderId: string): BehaviorSubject<DaffOrderTotal>
  getShippingTotal$(orderId: string): BehaviorSubject<DaffOrderTotal>
  getDiscountTotal$(orderId: string): BehaviorSubject<DaffOrderTotal>
  hasDiscount$(orderId: string): BehaviorSubject<boolean>
  getTaxTotal$(orderId: string): BehaviorSubject<DaffOrderTotal>
  dispatch(action: Action<string>)
}

Properties

Name Type Description
loading$ BehaviorSubject<boolean>
errors$ BehaviorSubject<DaffStateError[]>
loadingState$ BehaviorSubject<DaffState>
resolving$ BehaviorSubject<boolean>
mutating$ BehaviorSubject<boolean>
hasErrors$ BehaviorSubject<boolean>
orders$ BehaviorSubject<DaffOrder[]>
orderIds$ BehaviorSubject<DaffOrder['id'][]>
orderCount$ BehaviorSubject<number>
orderEntities$ BehaviorSubject<Dictionary<DaffOrder>>
placedOrder$ BehaviorSubject<DaffOrder>
hasPlacedOrder$ BehaviorSubject<boolean>
getOrder$ BehaviorSubject<DaffOrder>
getTotals$ BehaviorSubject<DaffOrder['totals']>
getAppliedCodes$ BehaviorSubject<DaffOrder['applied_codes']>
getItems$ BehaviorSubject<DaffOrder['items']>
getBillingAddresses$ BehaviorSubject<DaffOrder['billing_addresses']>
getShippingAddresses$ BehaviorSubject<DaffOrder['shipping_addresses']>
getShipments$ BehaviorSubject<DaffOrder['shipments']>
getPayment$ BehaviorSubject<DaffOrder['payment']>
getInvoices$ BehaviorSubject<DaffOrder['invoices']>
getCredits$ BehaviorSubject<DaffOrder['credits']>
getGrandTotal$ BehaviorSubject<DaffOrderTotal>

The specified order's grand total.

getSubtotal$ BehaviorSubject<DaffOrderTotal>

The specified order's subtotal.

getShippingTotal$ BehaviorSubject<DaffOrderTotal>

The specified order's shipping total.

getDiscountTotal$ BehaviorSubject<DaffOrderTotal>

The specified order's discount total.

hasDiscount$ BehaviorSubject<boolean>

Whether the specified order has a discount.

getTaxTotal$ BehaviorSubject<DaffOrderTotal>

The specified order's tax total.

dispatch