import { createStore } from "vuex";
import { State as MotiveStates, moduleMotive } from "./modules/motive";
import { State as TicketStates, moduleTicket } from "./modules/ticket";
import { State as CommentStates, moduleComment } from "./modules/comment";
import { State as AddresseeStates, moduleAddressee } from "./modules/addressee";
import { State as PersonsState, modulePersons } from "./modules/persons";
import {
  State as TicketListState,
  moduleTicketList,
} from "./modules/ticket_list";
import { State as UserState, moduleUser } from "./modules/user";

export interface RootState {
  motive: MotiveStates;
  ticket: TicketStates;
  comment: CommentStates;
  addressee: AddresseeStates;
  persons: PersonsState;
  ticketList: TicketListState;
  user: UserState;
}

export const store = createStore({
  modules: {
    motive: moduleMotive,
    ticket: moduleTicket,
    comment: moduleComment,
    addressee: moduleAddressee,
    persons: modulePersons,
    ticketList: moduleTicketList,
    user: moduleUser,
  },
});
