Add GET /api/billets/{id} endpoint to API doc (billet detail with image URL)

- Returns all billet fields: name, description, priceHT, quantity, sold, type, isGeneratedBillet, hasDefinedExit, notBuyable, position
- Includes imageUrl (absolute URL to billet picture if present, null otherwise)
- Includes nested category (id, name) and event (id, title)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-23 19:03:39 +01:00
parent 10d9051880
commit 17cf042379

View File

@@ -315,6 +315,27 @@ class ApiDocController extends AbstractController
403 => 'Evenement non accessible',
],
],
[
'method' => 'GET',
'path' => '/api/billets/{id}',
'summary' => 'Detail d\'un billet',
'description' => 'Retourne toutes les informations d\'un billet : nom, prix, quantite, type, description, image, categorie, etc.',
'headers' => $this->authHeaders(),
'params' => [
'id' => ['type' => 'int', 'required' => true, 'description' => 'ID du billet'],
],
'request' => null,
'response' => [
'success' => ['type' => 'bool', 'example' => true],
'data' => ['type' => 'object', 'example' => '{"id": 1, "name": "Entree VIP", "description": "Acces VIP avec boissons incluses", "priceHT": 2500, "quantity": 50, "sold": 18, "type": "billet", "isGeneratedBillet": true, "hasDefinedExit": false, "notBuyable": false, "position": 0, "imageUrl": "https://ticket.e-cosplay.fr/uploads/billets/entree-vip.jpg", "category": {"id": 3, "name": "Premium"}, "event": {"id": 1, "title": "Brocante 2026"}}'],
],
'statuses' => [
200 => 'Billet retourne',
401 => 'Non authentifie',
403 => 'Billet non accessible',
404 => 'Billet introuvable',
],
],
[
'method' => 'PATCH',
'path' => '/api/billets/{id}/stock',