All files / projects/organization-management/src/app/store/cost-centers cost-centers.actions.ts

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

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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 11257x       57x       57x   57x   57x         57x         57x   57x         57x   57x   57x         57x         57x         57x   57x         57x         57x   57x         57x   57x   57x         57x         57x   57x         57x         57x   57x         57x         57x   57x        
import { createAction } from '@ngrx/store';
 
import { CostCenter, CostCenterBase, CostCenterBuyer } from 'ish-core/models/cost-center/cost-center.model';
import { PagingInfo } from 'ish-core/models/paging-info/paging-info.model';
import { httpError, payload } from 'ish-core/utils/ngrx-creators';
 
import { CostCenterQuery } from '../../models/cost-center-query/cost-center-query.model';
 
export const loadCostCenters = createAction('[CostCenters] Load Cost Centers', payload<{ query: CostCenterQuery }>());
 
export const loadCostCentersFail = createAction('[CostCenters API] Load Cost Centers Fail', httpError());
 
export const loadCostCentersSuccess = createAction(
  '[CostCenters API] Load Cost Centers Success',
  payload<{ costCenters: CostCenter[]; paging: PagingInfo }>()
);
 
export const loadCostCenter = createAction(
  '[CostCenters Internal] Load Cost Center',
  payload<{ costCenterId: string }>()
);
 
export const loadCostCenterFail = createAction('[CostCenters API] Load Cost Center Fail', httpError());
 
export const loadCostCenterSuccess = createAction(
  '[CostCenters API] Load Cost Center Success',
  payload<{ costCenter: CostCenter }>()
);
 
export const addCostCenter = createAction('[CostCenters] Add Cost Center', payload<{ costCenter: CostCenterBase }>());
 
export const addCostCenterFail = createAction('[CostCenters API] Add Cost Center Fail', httpError());
 
export const addCostCenterSuccess = createAction(
  '[CostCenters API] Add Cost Center Success',
  payload<{ costCenter: CostCenter }>()
);
 
export const addCostCentersFromCsv = createAction(
  '[CostCenters] Add Cost Centers from CSV',
  payload<{ costCenters: CostCenterBase[] }>()
);
 
export const addCostCenterFromCsvSingleResult = createAction(
  '[CostCenter API] Add Cost Center from CSV Single Result',
  payload<{ importResult: { costCenter: CostCenterBase; status: string } }>()
);
 
export const addCostCentersFromCsvComplete = createAction('[CostCenter API] Add CostCenters from CSV Complete');
 
export const addCostCentersFromCsvImportTotal = createAction(
  '[CostCenter API] Add Cost Center from CSV Import Total',
  payload<{ totalCostCenters: number }>()
);
 
export const updateCostCenter = createAction(
  '[CostCenters] Update Cost Center',
  payload<{ costCenter: CostCenterBase }>()
);
 
export const updateCostCenterFail = createAction('[CostCenters API] Update Cost Center Fail', httpError());
 
export const updateCostCenterSuccess = createAction(
  '[CostCenters API] Update Cost Center Success',
  payload<{ costCenter: CostCenter }>()
);
 
export const deleteCostCenter = createAction('[CostCenters] Delete Cost Center', payload<{ id: string }>());
 
export const deleteCostCenterFail = createAction('[CostCenters API] Delete Cost Center Fail', httpError());
 
export const deleteCostCenterSuccess = createAction(
  '[CostCenters API] Delete Cost Center Success',
  payload<{ id: string }>()
);
 
export const addCostCenterBuyers = createAction(
  '[CostCenters] Add Cost Center Buyers',
  payload<{ costCenterId: string; buyers: CostCenterBuyer[] }>()
);
 
export const addCostCenterBuyersFail = createAction('[CostCenters API] Add Cost Center Buyers Fail', httpError());
 
export const addCostCenterBuyersSuccess = createAction(
  '[CostCenters API] Add Cost Center Buyers Success',
  payload<{ costCenter: CostCenter }>()
);
 
export const updateCostCenterBuyer = createAction(
  '[CostCenters] Update Cost Center Buyer',
  payload<{ costCenterId: string; buyer: CostCenterBuyer }>()
);
 
export const updateCostCenterBuyerFail = createAction('[CostCenters API] Update Cost Center Buyer Fail', httpError());
 
export const updateCostCenterBuyerSuccess = createAction(
  '[CostCenters API] Update Cost Center Buyer Success',
  payload<{ costCenter: CostCenter }>()
);
 
export const deleteCostCenterBuyer = createAction(
  '[CostCenters] Delete Cost Center Buyer',
  payload<{ costCenterId: string; login: string }>()
);
 
export const deleteCostCenterBuyerFail = createAction('[CostCenters API] Delete Cost Center Buyer Fail', httpError());
 
export const deleteCostCenterBuyerSuccess = createAction(
  '[CostCenters API] Delete Cost Center Buyer Success',
  payload<{ costCenter: CostCenter }>()
);