import { defineStore } from 'pinia'
import { reactive } from 'vue'
import { useGlobalStore } from '@/stores/globalStore'

export const usePiyangoContactStore = defineStore('piyangoContactStore', () => {
  const globalStore = useGlobalStore()

  const baseContactData = reactive<Record<string, any>>({
    adSoyad: '',
    telefonNumarasi: '',
    faksNumarasi: '',
    eposta: '',
    unvan: ''
  })
  const contactData = reactive<Record<string, any>>({})
  const safeContactData = reactive<Record<string, any>>({})

  const ResetFormData = () => {
    globalStore.ResetObject(contactData, baseContactData)
    Object.assign(contactData, baseContactData)
  }

  return { baseContactData, contactData, safeContactData, ResetFormData }
})
