import * as actions from './actions'
import getters from './getters'
import mutations from './mutations'
import {
  MY_ACCOUNT_ADDRESS_DINAMIC_CONTENT,
  MY_ACCOUNT_BANK_INFO_DINAMIC_CONTENT,
  MY_ACCOUNT_TAX_PAYER_INFO,
} from '../../utils/localStorageKeys'

const state = {
  memberDetails: {
    address: {
      address_data: [],
      created_at: '',
      id: '',
      updated_at: '',
      user_id: '',
    },
    banking: {
      created_at: '',
      id: '',
      payment_data: {
        selected: '',
        bank_data: [],
      },
      updated_at: '',
      user_id: '',
    },
    beneficiary: null,
    contact_info: {
      tel_office_1_num: null,
      tel_home_1_num: null,
    },
    details: {
      id: null,
      user_id: null,
      country_id: null,
      avatar_image_link: null,
      avatar_image_path: null,
      name: null,
      translated_name: null,
      nationality_id: 1,
      ic_pass_type_id: 13,
      active_until_cw_id: null,
      ic_passport_number: null,
      date_of_birth: null,
      cw: null,
      join_date: null,
      expiry_date: null,
      personal_sales_cv: null,
      personal_sales_cv_percentage: null,
      effective_rank_id: null,
      highest_rank_id: null,
      enrollment_rank_id: null,
      tin_no_taiwan: null,
      tin_no_philippines: null,
      enroll_from_received: null,
      ic_pass_verified: null,
      defer_bonus_commission: null,
      defer_reason_id: null,
      bank_type: null,
      status_id: 65,
      created_by: null,
      updated_by: null,
      created_at: null,
      updated_at: null,
      effective_rank: {
        id: null,
        rank_code: null,
        rank_name: null,
        min_ps: null,
        no_of_lines: null,
        min_line_rank_id: null,
        line_rank_count: null,
        min_payleg_gcv: null,
        max_gcv_bf: null,
        max_payout: null,
        total_active_ba: null,
        status: null,
        created_at: null,
        updated_at: null,
      },
      highest_rank: {
        id: null,
        rank_code: null,
        rank_name: null,
        min_ps: null,
        no_of_lines: null,
        min_line_rank_id: null,
        line_rank_count: null,
        min_payleg_gcv: null,
        max_gcv_bf: null,
        max_payout: null,
        total_active_ba: null,
        status: null,
        created_at: null,
        updated_at: null,
      },
      country: {
        id: null,
        name: null,
        code: null,
        code_iso_2: null,
        call_code: null,
        tax_desc: null,
        default_currency_id: null,
        active: null,
        created_by: null,
        updated_by: null,
        deleted_at: null,
        created_at: null,
        updated_at: null,
      },
      enrollment_rank: {
        id: null,
        rank_code: null,
        rank_name: null,
        CV: null,
        entitlement_lvl: null,
        created_by: null,
        updated_by: null,
        created_at: null,
        updated_at: null,
        sales_types: {},
      },
      sponsor: {
        id: null,
        user_id: null,
        sponsor_parent_user_id: null,
        sponsor_node_key: null,
        sponsor_depth_level: null,
        sponsor_node_left: null,
        sponsor_node_right: null,
        placement_parent_user_id: null,
        placement_node_key: null,
        placement_depth_level: null,
        placement_node_left: null,
        placement_node_right: null,
        placement_position: null,
        sponsor_position: null,
        created_at: null,
        updated_at: null,
        member: {
          id: null,
          user_id: null,
          country_id: null,
          avatar_image_link: null,
          avatar_image_path: null,
          name: null,
          translated_name: null,
          nationality_id: null,
          ic_pass_type_id: null,
          active_until_cw_id: null,
          ic_passport_number: null,
          date_of_birth: null,
          cw: null,
          join_date: null,
          expiry_date: null,
          personal_sales_cv: null,
          personal_sales_cv_percentage: null,
          effective_rank_id: null,
          highest_rank_id: null,
          enrollment_rank_id: null,
          tin_no_taiwan: null,
          tin_no_philippines: null,
          enroll_from_received: 0,
          ic_pass_verified: 0,
          defer_bonus_commission: 0,
          defer_reason_id: null,
          bank_type: null,
          status_id: null,
          created_by: null,
          updated_by: null,
          created_at: null,
          updated_at: null,
          user: {
            id: null,
            old_ibs_user_id: null,
            name: null,
            unique_login_id: null,
            old_member_id: null,
            mobile: null,
            email: null,
            active: null,
            login_count: null,
            created_by: null,
            update_by: null,
            created_at: null,
            updated_at: null,
          },
        },
      },
      placement: {
        name: null,
        ibo: null,
        leg: null,
      },
      member_id: null,
      user: {
        id: null,
        old_ibs_user_id: null,
        name: null,
        unique_login_id: null,
        old_member_id: null,
        mobile: null,
        email: null,
        active: null,
        login_count: null,
        created_by: 0,
        update_by: 0,
        created_at: null,
        updated_at: null,
      },
      status: {
        id: null,
        master_id: null,
        title: null,
        sort: 0,
        created_by: null,
        updated_by: null,
      },
    },
    information: {
      gender_id: null,
      language_id: null,
    },
    ewallet: null,
    sales_history: null,
    tax: null,
    upline: null,
    verification: null,
  },
  countryDinamicContent: {
    address: JSON.parse(localStorage.getItem(MY_ACCOUNT_ADDRESS_DINAMIC_CONTENT)) || null,
    memberPayoutOptions: JSON.parse(localStorage.getItem(MY_ACCOUNT_BANK_INFO_DINAMIC_CONTENT)) || null,
    taxpayerInfo: JSON.parse(localStorage.getItem(MY_ACCOUNT_TAX_PAYER_INFO)) || null,
  },
  avatarFile: '',
  bonusInfoData: {
    bank: {
      country: '',
      bankName: '',
      swiftCode: '',
      accountNumber: '',
      accountName: '',
    },
    mpay: {
      country: '',
      cardHolderName: '',
      cardNumber: '',
      cardExpiryDate: '',
    },
  },
  countriesList: [],
  // bankList: [],
  selectedCountryId: 1,
  ethnicGroupList: [],
  maritalStatusList: [],
  genderList: [],
  citiesList: [],
  preferredContactList: [],
  expiryMonthRange: [
    { text: 'MM', value: '' },
    { text: '01', value: '01' },
    { text: '02', value: '02' },
    { text: '03', value: '03' },
    { text: '04', value: '04' },
    { text: '05', value: '05' },
    { text: '06', value: '06' },
    { text: '07', value: '07' },
    { text: '08', value: '08' },
    { text: '09', value: '09' },
    { text: '10', value: '10' },
    { text: '11', value: '11' },
    { text: '12', value: '12' },
  ],
  expiryYearRange: [{ text: 'YY', value: '' }],
  placementPreference: {
    preference: 0,
    next_placement: 0,
  },
  ampAccumulations: [],
}

export default {
  state,
  actions,
  mutations,
  getters,
}
