import { defineStore } from 'pinia'

// Default tenant ID format: name@ash@year
const DEFAULT_TENANT_ID = 'default@ash@2026'

export const useTenantStore = defineStore('tenant', {
  state: () => ({
    currentTenantId: localStorage.getItem('X-Tenant-Id') || DEFAULT_TENANT_ID
  }),
  actions: {
    setTenant(id: string) {
      this.currentTenantId = id
      localStorage.setItem('X-Tenant-Id', id)
    }
  }
})
