fix : corrections de l'entity customer.php et de la partie admin front qui lui est lié + update des fixtures/seed
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-02-13 13:44:21 +01:00
parent c361ef9bb9
commit 93edd0a563
11 changed files with 462 additions and 54 deletions

View File

@@ -15,8 +15,9 @@
</div>
<div class="grid grid-cols-2 gap-y-8 gap-x-80 mb-10 py-12">
<UiTextInput id="customer-label" v-model="form.label" label="Nom du client" :disabled="!auth.isAdmin"/>
<UiTextInput id="customer-code" v-model="form.code" label="Code" :disabled="!auth.isAdmin"/>
<UiTextInput id="customer-name" v-model="form.name" label="Nom du client" :disabled="!auth.isAdmin"/>
<UiTextInput id="customer-phone" v-model="form.phone" label="Téléphone" :disabled="!auth.isAdmin"/>
<UiTextInput id="customer-email" v-model="form.email" label="Email" :disabled="!auth.isAdmin"/>
</div>
<div class="mx-24 mb-4 py-6 border-t border-black"></div>
@@ -94,8 +95,9 @@ const resolveId = (param: unknown) => {
const customerId = computed(() => resolveId(route.params.id))
const isLoading = ref(false)
const form = reactive<CustomerFormData>({
label: "",
code: "",
name: "",
phone: "",
email: "",
addresses: [],
})
@@ -122,8 +124,9 @@ const goToEditAddress = (addressId: number | null) => {
const hydrateFromCustomer = (customer: CustomerData | null) => {
if (!customer) return
form.label = customer.label ?? ""
form.code = customer.code ?? ""
form.name = customer.name ?? ""
form.phone = customer.phone ?? ""
form.email = customer.email ?? ""
if (!Array.isArray(customer.addresses) || customer.addresses.length === 0) {
form.addresses = []
return
@@ -165,12 +168,14 @@ async function validate() {
isLoading.value = true
try {
const label = form.label.trim()
const code = form.code.trim()
const name = form.name.trim()
const phone = form.phone?.trim() || null
const email = form.email?.trim() || null
const customerPayload: CustomerPayload = {
label,
code,
name,
phone,
email,
}
let targetId: number | null = null