All files / src/app/core/store/customer/orders orders.actions.ts

100% Statements 17/17
100% Branches 0/0
100% Functions 0/0
100% Lines 17/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49  158x       158x   158x   158x   158x   158x   158x   158x   158x         158x   158x         158x   158x   158x   158x         158x         158x  
import { Params } from '@angular/router';
import { createAction } from '@ngrx/store';
 
import { OrderListQuery } from 'ish-core/models/order-list-query/order-list-query.model';
import { Order } from 'ish-core/models/order/order.model';
import { httpError, payload } from 'ish-core/utils/ngrx-creators';
 
export const createOrder = createAction('[Orders Internal] Create Order');
 
export const createOrderFail = createAction('[Orders API] Create Order Fail', httpError());
 
export const createOrderSuccess = createAction('[Orders API] Create Order Success', payload<{ order: Order }>());
 
export const loadOrders = createAction('[Orders] Load Orders', payload<{ query: OrderListQuery }>());
 
export const loadMoreOrders = createAction('[Orders] Load More Orders');
 
export const loadOrdersFail = createAction('[Orders API] Load Orders Fail', httpError());
 
export const loadOrdersSuccess = createAction(
  '[Orders API] Load Orders Success',
  payload<{ orders: Order[]; query: OrderListQuery; allRetrieved?: boolean }>()
);
 
export const loadOrder = createAction('[Orders Internal] Load Order', payload<{ orderId: string }>());
 
export const loadOrderByAPIToken = createAction(
  '[Orders Internal] Load Order using given API Token',
  payload<{ apiToken: string; orderId: string }>()
);
 
export const loadOrderFail = createAction('[Orders API] Load Order Fail', httpError());
 
export const loadOrderSuccess = createAction('[Orders API] Load Order Success', payload<{ order: Order }>());
 
export const selectOrder = createAction('[Orders Internal] Select Order', payload<{ orderId: string }>());
 
export const selectOrderAfterRedirect = createAction(
  '[Orders Internal] Select Order After Checkout Redirect',
  payload<{ params: Params }>()
);
 
export const selectOrderAfterRedirectFail = createAction(
  '[Orders API] Select Order Fail After Checkout Redirect',
  httpError()
);
 
export const resetOrderErrors = createAction('[Order Internal] Reset Order Errors');