From 93edd0a563050d61507402c8adf05e6071184079 Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 13 Feb 2026 13:44:21 +0100 Subject: [PATCH] =?UTF-8?q?fix=20:=20corrections=20de=20l'entity=20custome?= =?UTF-8?q?r.php=20et=20de=20la=20partie=20admin=20front=20qui=20lui=20est?= =?UTF-8?q?=20li=C3=A9=20+=20update=20des=20fixtures/seed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/shipment/shipment-form.vue | 2 +- frontend/pages/admin/customer/[[id]].vue | 25 +-- .../pages/admin/customer/customer-list.vue | 28 +-- frontend/services/dto/customer-data.ts | 15 +- migrations/Version20260213093000.php | 32 ++++ migrations/Version20260213101500.php | 37 ++++ src/Command/SeedCommand.php | 166 +++++++++++++++++- src/DataFixtures/AppFixtures.php | 1 - src/DataFixtures/ReferenceFixtures.php | 156 +++++++++++++++- src/DataFixtures/TransportFixtures.php | 10 +- src/Entity/Customer.php | 44 +++-- 11 files changed, 462 insertions(+), 54 deletions(-) create mode 100644 migrations/Version20260213093000.php create mode 100644 migrations/Version20260213101500.php diff --git a/frontend/components/shipment/shipment-form.vue b/frontend/components/shipment/shipment-form.vue index 9545d63..4400332 100644 --- a/frontend/components/shipment/shipment-form.vue +++ b/frontend/components/shipment/shipment-form.vue @@ -49,7 +49,7 @@ label="Client" :options="customers.map((customer) => ({ value: String(customer.id), - label: customer.label + label: customer.name || `Client #${customer.id}` }))" :loading="isLoadingCustomers" wrapper-class="col-start-1 row-start-5" diff --git a/frontend/pages/admin/customer/[[id]].vue b/frontend/pages/admin/customer/[[id]].vue index 8019c75..d00a82c 100644 --- a/frontend/pages/admin/customer/[[id]].vue +++ b/frontend/pages/admin/customer/[[id]].vue @@ -15,8 +15,9 @@
- - + + +
@@ -94,8 +95,9 @@ const resolveId = (param: unknown) => { const customerId = computed(() => resolveId(route.params.id)) const isLoading = ref(false) const form = reactive({ - 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 diff --git a/frontend/pages/admin/customer/customer-list.vue b/frontend/pages/admin/customer/customer-list.vue index a25c702..341f688 100644 --- a/frontend/pages/admin/customer/customer-list.vue +++ b/frontend/pages/admin/customer/customer-list.vue @@ -14,10 +14,11 @@
Nom
-
Code
+
Téléphone
+
Email
Rue
Complément
Code Postal
@@ -26,17 +27,18 @@
- Aucun fournisseur. + Aucun client.
-
{{ customer.label }}
-
{{ customer.code }}
+
{{ customer.name || "—" }}
+
{{ customer.phone || "—" }}
+
{{ customer.email || "—" }}
Pas d'adresse
{{"—"}}
{{"—"}}
@@ -48,14 +50,15 @@
- {{ idx === 0 ? customer.label : "↳" }} + {{ idx === 0 ? (customer.name || "—") : "↳" }}
-
{{ idx === 0 ? customer.code : "" }}
+
{{ idx === 0 ? (customer.phone || "—") : "" }}
+
{{ idx === 0 ? (customer.email || "—") : "" }}
{{ address.street || "—" }}
{{ address.street2 || "—" }}
{{ address.postalCode || "—" }}
@@ -66,11 +69,12 @@