- InlineField component + useInlineEdit composable for Odoo-style dblclick editing - Client search by name, account ID, and legacy_customer_id (or_filters) - SMS/Email notification panel on ContactCard via n8n webhooks - Ticket reply thread via Communication docs - All migration scripts (51 files) now tracked - Client portal and field tech app added to monorepo - README rewritten with full feature list, migration summary, architecture - CHANGELOG updated with all recent work - ROADMAP updated with current completion status - Removed hardcoded tokens from docs (use $ERP_SERVICE_TOKEN) - .gitignore updated (docker/, .claude/, exports/, .quasar/) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
825 B
JavaScript
30 lines
825 B
JavaScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
import { getPortalUser } from 'src/api/portal'
|
|
|
|
export const useCustomerStore = defineStore('customer', () => {
|
|
const email = ref('')
|
|
const customerId = ref('')
|
|
const customerName = ref('')
|
|
const loading = ref(true)
|
|
const error = ref(null)
|
|
|
|
async function init () {
|
|
loading.value = true
|
|
error.value = null
|
|
try {
|
|
const user = await getPortalUser()
|
|
email.value = user.email
|
|
customerId.value = user.customer_id
|
|
customerName.value = user.customer_name
|
|
} catch (e) {
|
|
console.error('Failed to resolve customer:', e)
|
|
error.value = e.message || 'Impossible de charger votre compte'
|
|
} finally {
|
|
loading.value = false
|
|
}
|
|
}
|
|
|
|
return { email, customerId, customerName, loading, error, init }
|
|
})
|