Simplify scan API: remove /verify, add accepted/refused state with reason and details

- Remove POST /api/scan/verify (redundant with /api/scan)
- POST /api/scan now returns state: "accepted" or "refused" with reason
- Refused reasons: already_scanned, invalid, expired, exit_definitive, wrong_event
- Accepted response includes details object (for future additional data)
- Template: render extra section (refusal reasons table in red)
- Only 2 POST routes remain: /api/auth/login + /api/scan (all others are GET)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-23 19:06:13 +01:00
parent 8a65df5c7c
commit 9981121638
2 changed files with 28 additions and 23 deletions

View File

@@ -230,6 +230,22 @@
</div>
{% endif %}
{% if endpoint.extra is defined %}
<div class="mb-4">
<p class="text-[10px] font-black uppercase tracking-widest text-gray-400 mb-2">{{ endpoint.extra.title }}</p>
<div class="border-2 border-red-200 bg-red-50 p-4">
<table class="w-full text-xs">
{% for code, desc in endpoint.extra.items %}
<tr class="{{ not loop.last ? 'border-b border-red-200' : '' }}">
<td class="py-1.5 font-mono font-bold text-red-700 pr-4">{{ code }}</td>
<td class="py-1.5 font-bold text-red-600">{{ desc }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
{% if endpoint.statuses|length > 0 %}
<div>
<p class="text-[10px] font-black uppercase tracking-widest text-gray-400 mb-2">Codes de reponse</p>