import { EntityState, createEntityAdapter } from '@ngrx/entity';
import { OrderHistory, OrderHistoryStatus } from '../defs';

export interface HistoryState extends EntityState<OrderHistory> {}

export const historyStateAdapter = createEntityAdapter<OrderHistory>();

export const INITIAL_HISTORY_STATE: HistoryState = {
  ...historyStateAdapter.getInitialState(),
};

export const INITIAL_ORDER_HISTORY: OrderHistory = {
  id: undefined,
  status: OrderHistoryStatus.INIT,
  histories: [],
};
