import * as T from '../../utils/types'
import * as L from '../../utils/localStorageKeys'

export default {
  [T.SET_CAMPAIGN_LIST](state, data) {
    state.campaignList = data
  },
  [T.SET_CW_SCHEDULE_LIST](state, data) {
    state.cwScheduleList = data
    localStorage.setItem(L.CW_SCHEDULE_LIST, JSON.stringify(state.cwScheduleList))
  },
  [T.SET_CW_SCHEDULE_LIST_PAST](state, data) {
    state.cwScheduleListPast = data
  },
  [T.SET_WEEKLY_BONUS_STATEMENT_DATA](state, data) {
    state.weeklyBonusStatementData = data
  },
  [T.SET_MEMBER_CAMPAIGN_REPORT](state, data) {
    state.memberCampaignReport = data.data || []
    state.memberCampaignReportColumns =
      data.setting === null || data.setting.columns === null ? [] : data.setting.columns
    state.memberCampaignReportFootnotes =
      data.setting === null || data.setting.footnotes === null ? [] : data.setting.footnotes
  },
  [T.SET_ANNUAL_INCOME_STATEMENT_DATA](state, data) {
    state.annualIncomeStatementData = data
  },
  [T.SET_WELCOME_BONUS_DAILY_DATA](state, data) {
    state.welcomeBonusDailyData = data
  },
  [T.SET_AUTHORIZED_REPORT_LIST](state, data) {
    state.authorizedReportListData = data
  },
}
