Enhance API parameter documentation and introduce reusable component
- Added a new Blade component `<x-logistics.param-table>` for displaying API parameter tables across all Filament pages, ensuring consistent styling and reducing HTML duplication. - Integrated parameter tables for each endpoint in the Articles, Documents, Divers, Journaux, Tiers, and other pages, providing users with clear reference information. - Updated the documentation to reflect the new structure and details of API parameters, including required fields and descriptions. - Improved user experience by ensuring that endpoints without parameters do not display empty tables. - Overall, enhanced the clarity and usability of API interactions within the application.
This commit is contained in:
26
resources/views/components/logistics/param-table.blade.php
Normal file
26
resources/views/components/logistics/param-table.blade.php
Normal file
@@ -0,0 +1,26 @@
|
||||
@props(['params'])
|
||||
|
||||
@if (count($params) > 0)
|
||||
<div class="mt-6 overflow-x-auto">
|
||||
<table class="w-full text-left text-sm">
|
||||
<thead>
|
||||
<tr class="border-b border-gray-200 dark:border-white/10">
|
||||
<th class="px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Parametre</th>
|
||||
<th class="px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Type</th>
|
||||
<th class="px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Obligatoire</th>
|
||||
<th class="px-3 py-2.5 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-white/5">
|
||||
@foreach ($params as $param)
|
||||
<tr>
|
||||
<td class="px-3 py-2.5 font-mono text-sm text-gray-700 dark:text-gray-300">{{ $param['name'] }}</td>
|
||||
<td class="px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300">{{ $param['type'] }}</td>
|
||||
<td class="px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300">{{ $param['required'] }}</td>
|
||||
<td class="px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300">{{ $param['description'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
@@ -46,6 +46,8 @@
|
||||
<span class="text-sm text-gray-500">Recherche en cours...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableArtList()" />
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
|
||||
@@ -97,6 +99,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableArtGetstk()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getStock" class="mt-4">
|
||||
<x-logistics.json-block :data="$stockData" :searched="$hasCheckedStock" />
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="[]" />
|
||||
|
||||
<div wire:loading.remove wire:target="getSerialNumber" class="mt-4">
|
||||
<x-logistics.json-block :data="$serialData" :searched="$hasSerial" />
|
||||
</div>
|
||||
@@ -34,20 +36,31 @@
|
||||
|
||||
{{-- codes_list --}}
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="codes_list" description="Données associées à un code interne (table incodes)" />
|
||||
<x-logistics.section-header title="codes_list" description="Données associées à un code interne (table incodes). Correspondance exacte, sensible à la casse (MAJUSCULES)." />
|
||||
<div class="p-6">
|
||||
<div class="flex items-end gap-4">
|
||||
<div class="flex-1">
|
||||
<x-logistics.form-field
|
||||
wire:model="code"
|
||||
label="Début de code (code)"
|
||||
id="code"
|
||||
placeholder="Ex: PAY"
|
||||
/>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<x-logistics.form-field
|
||||
wire:model="code"
|
||||
label="Nom du groupe de codes (code)"
|
||||
id="code"
|
||||
placeholder="Ex: PAYMODE, PAYDELAY, VAT, STOCK"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="codesSelect"
|
||||
label="Colonnes (select)"
|
||||
id="codesSelect"
|
||||
placeholder="Sans effet -- toutes les colonnes sont retournées"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex items-center gap-3">
|
||||
<x-filament::button wire:click="searchCodes" icon="heroicon-o-magnifying-glass">
|
||||
Rechercher
|
||||
</x-filament::button>
|
||||
<div wire:loading wire:target="searchCodes" class="flex items-center gap-2">
|
||||
<x-filament::loading-indicator class="h-4 w-4 text-primary-500" />
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div wire:loading wire:target="searchCodes" class="mt-4 flex items-center gap-2">
|
||||
@@ -55,61 +68,70 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableCodesList()" />
|
||||
|
||||
<div wire:loading.remove wire:target="searchCodes" class="mt-4">
|
||||
<x-logistics.json-block :data="$codesData" :searched="$hasCodes" />
|
||||
</div>
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
|
||||
@else
|
||||
{{-- custom_geninv_updatestock --}}
|
||||
<x-logistics.card>
|
||||
<x-logistics.section-header title="custom_geninv_updatestock" description="Mise à jour de l'inventaire" />
|
||||
<x-logistics.section-header title="custom_geninv_updatestock" description="Mise à jour du stock (réapprovisionnement ou inventaire)" />
|
||||
<div class="p-6">
|
||||
<div class="mb-4 rounded-lg bg-amber-50 p-3 text-sm text-amber-700 dark:bg-amber-400/10 dark:text-amber-400">
|
||||
Endpoint non fonctionnel -- la valeur attendue de STKID et la signification de certains paramètres (TOCHECK, TOCHECKDETAIL, MODE) sont inconnues.
|
||||
MODE=0 (Inventaire) necessite un journal KI configure pour le depot. MODE=1 (Restock) fonctionne et necessite un THIRDID (fournisseur).
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
<x-logistics.form-field
|
||||
wire:model="stkArtId"
|
||||
label="Article (ARTID)"
|
||||
id="stkArtId"
|
||||
placeholder="Ex: ART001"
|
||||
placeholder="Ex: 003R92572"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkId"
|
||||
label="Identifiant stock (STKID)"
|
||||
label="Depot / Entrepot (STKID)"
|
||||
id="stkId"
|
||||
placeholder="Valeur inconnue"
|
||||
placeholder="Ex: SG, A"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkQty"
|
||||
label="Quantité (QTY)"
|
||||
label="Quantite (QTY)"
|
||||
id="stkQty"
|
||||
placeholder="Ex: 10"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkToCheck"
|
||||
label="TOCHECK (signification inconnue)"
|
||||
id="stkToCheck"
|
||||
placeholder="Prix ?"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkToCheckDetail"
|
||||
label="TOCHECKDETAIL (signification inconnue)"
|
||||
id="stkToCheckDetail"
|
||||
placeholder="Remarques ?"
|
||||
placeholder="Ex: 10 (negatif possible)"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkMode"
|
||||
label="MODE (signification inconnue)"
|
||||
label="Mode (MODE)"
|
||||
id="stkMode"
|
||||
placeholder="Valeur inconnue"
|
||||
placeholder="0=Inventaire, 1=Restock"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkThirdId"
|
||||
label="Tiers / Fournisseur (THIRDID)"
|
||||
id="stkThirdId"
|
||||
placeholder="Obligatoire si MODE=1"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkToCheck"
|
||||
label="Prix de controle (TOCHECK)"
|
||||
id="stkToCheck"
|
||||
placeholder="Ex: 12.50"
|
||||
/>
|
||||
<x-logistics.form-field
|
||||
wire:model="stkToCheckDetail"
|
||||
label="Detail de controle (TOCHECKDETAIL)"
|
||||
id="stkToCheckDetail"
|
||||
placeholder="Remarques"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex items-center gap-3">
|
||||
<x-filament::button wire:click="updateStock" icon="heroicon-o-arrow-path" color="warning">
|
||||
Mettre à jour le stock
|
||||
Mettre a jour le stock
|
||||
</x-filament::button>
|
||||
<div wire:loading wire:target="updateStock" class="flex items-center gap-2">
|
||||
<x-filament::loading-indicator class="h-4 w-4 text-primary-500" />
|
||||
@@ -117,6 +139,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableUpdateStock()" />
|
||||
|
||||
<div wire:loading.remove wire:target="updateStock" class="mt-4">
|
||||
<x-logistics.json-block :data="$updateStockResult" :searched="$hasUpdatedStock" />
|
||||
</div>
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
<span class="text-sm text-gray-500">Recherche en cours...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableDocumentList()" />
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
|
||||
@@ -110,6 +112,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableDocumentDetail()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getDocumentDetail" class="mt-4">
|
||||
<x-logistics.json-block :data="$detailData" :searched="$hasDetail" />
|
||||
</div>
|
||||
@@ -139,6 +143,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableStatusList()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getStatusList" class="mt-4">
|
||||
<x-logistics.json-block :data="$statusData" :searched="$hasStatus" />
|
||||
</div>
|
||||
@@ -192,6 +198,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableUnitPriceAndVat()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getUnitPriceAndVat" class="mt-4">
|
||||
<x-logistics.json-block :data="$priceData" :searched="$hasPrice" />
|
||||
</div>
|
||||
@@ -227,6 +235,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableDueDate()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getDueDate" class="mt-4">
|
||||
<x-logistics.json-block :data="$dueDateData" :searched="$hasDueDate" />
|
||||
</div>
|
||||
@@ -262,6 +272,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableAttachListThumbnail()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getAttachListThumbnail" class="mt-4">
|
||||
<x-logistics.json-block :data="$attachData" :searched="$hasAttach" />
|
||||
</div>
|
||||
@@ -303,6 +315,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableGetPdf()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getPdf" class="mt-4">
|
||||
<x-logistics.json-block :data="$pdfData" :searched="$hasPdf" />
|
||||
</div>
|
||||
@@ -384,6 +398,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableDocumentAdd()" />
|
||||
|
||||
<div wire:loading.remove wire:target="addDocument" class="mt-4">
|
||||
<x-logistics.json-block :data="$addResult" :searched="$hasAdded" />
|
||||
</div>
|
||||
@@ -443,6 +459,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableDocumentMod()" />
|
||||
|
||||
<div wire:loading.remove wire:target="modDocument" class="mt-4">
|
||||
<x-logistics.json-block :data="$modResult" :searched="$hasModified" />
|
||||
</div>
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
<span class="text-sm text-gray-500">Recherche en cours...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableJnlList()" />
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
<span class="text-sm text-gray-500">Recherche en cours...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableThirdList()" />
|
||||
</div>
|
||||
</x-logistics.card>
|
||||
|
||||
@@ -99,6 +101,8 @@
|
||||
<span class="text-sm text-gray-500">Chargement...</span>
|
||||
</div>
|
||||
|
||||
<x-logistics.param-table :params="$this->paramTableArtHistory()" />
|
||||
|
||||
<div wire:loading.remove wire:target="getArtHistory" class="mt-4">
|
||||
<x-logistics.json-block :data="$historyData" :searched="$hasHistory" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user