import { Query } from '@datorama/akita';
import sessionStore from './session.store';
export class SessionQuery extends Query {
  constructor(store) {
    super(store);
    this.store = store;
    this.vehicle$ = this.select((state) => state.vehicle);
    this.user$ = this.select((state) => state.user);
    this.result$ = this.select((state) => state.quote);
    this.userDetails$ = this.select((state) => state.userDetails);
    this.makeList$ = this.select((state) => state.refLists.makeList);
    this.modelList$ = this.select((state) => state.refLists.modelList);
    this.yearList$ = this.select((state) => state.refLists.yearList);
    this.bodyTypeList$ = this.select((state) => state.refLists.bodyTypeList);
    this.modelVariantsList$ = this.select((state) => state.refLists.modelVariantsList);
    this.selectedVariant$ = this.select((state) => state.vehicle.selectedVariant);
    this.quote$ = this.select((state) => state.quote);
  }
  get distinctUserId() {
    return this.getValue().distinctUserId;
  }
  get selectedVariant() {
    return this.getValue().vehicle.selectedVariant;
  }
  get vehicle() {
    return this.getValue().vehicle;
  }
  get user() {
    return this.getValue().user;
  }
  get result() {
    return this.getValue().quote;
  }
  get userDetails() {
    return this.getValue().userDetails;
  }
}
export default new SessionQuery(sessionStore);
