import { GoodsInState, GoodsInStateModel } from '../state/goods-in.state';
import { Selector } from '@ngxs/store';

export class GoodsInSelectors {
  @Selector([GoodsInState])
  static getGoodsIn(state: GoodsInStateModel) {
    return state.goodsIn;
  }

  @Selector([GoodsInState])
  static getGoodsInCurrentSearch(state: GoodsInStateModel) {
    return state.goodsIn.currentSearch;
  }

  @Selector([GoodsInState])
  static getCachedGoodsInOrders(state: GoodsInStateModel) {
    return state.goodsIn.cachedOrders;
  }

  @Selector([GoodsInState])
  static getGoodsInCacheState(state: GoodsInStateModel) {
    return state.goodsIn.useCache ? state.goodsIn.useCache : false;
  }
}
