import {
  SET_MEMBER_DASHBOARD,
  SET_TEAM_BONUS_RANKS,
  SET_MEMBER_DASHBOARD_MENTOR_BONUS_DETAIL,
  SET_MEMBER_DASHBOARD_TEAM_BONUS_DETAIL,
  SET_MEMBER_DASHBOARD_WELCOME_BONUS_DETAIL,
  SET_MEMBER_DASHBOARD_BA_INACTIVE_DETAIL,
} from '../../utils/types'

export default {
  [SET_TEAM_BONUS_RANKS](state, data) {
    state.teamBonusRanks = data
  },
  [SET_MEMBER_DASHBOARD](state, data) {
    state.memberDashboard = data
    state.totalSponsored = data.total_sponsored_graph || {}
    state.totalGcv = data.total_tvc_graph
    state.mySnapshot = data.my_snapshot || {}
    state.welcomeBonus = data.welcome_bonus || {}
    state.teamBonus = data.team_bonus || {}
    state.mentorBonus = data.mentor_bonus || {}
    state.quarterlyDividend = data.quarterly_dividend || {}
  },
  [SET_MEMBER_DASHBOARD_MENTOR_BONUS_DETAIL](state, data) {
    state.mentorBonusDetail = data
  },
  [SET_MEMBER_DASHBOARD_TEAM_BONUS_DETAIL](state, data) {
    state.teamBonusDetail = data
  },
  [SET_MEMBER_DASHBOARD_WELCOME_BONUS_DETAIL](state, data) {
    state.welcomeBonusDetail = data
  },
  [SET_MEMBER_DASHBOARD_BA_INACTIVE_DETAIL](state, data) {
    state.baInactiveDetail = data
  },
}
