add webhooks for refused signature contrat

This commit is contained in:
Serreau Jovann
2026-02-16 09:12:49 +01:00
parent 6fb7ef088b
commit 478dc90aa5

View File

@@ -43,14 +43,31 @@
<div class="contrat-card relative overflow-hidden group"> <div class="contrat-card relative overflow-hidden group">
{# --- BANNIÈRE DE LITIGE (Si signature refusée) --- #} {# --- BANNIÈRE DE REFUS (Prioritaire) --- #}
{% if contrat.etatLieux and contrat.etatLieux.status == 'edl_return_refused' %} {% if contrat.refused %}
<div class="bg-red-600/20 border-b border-red-500/30 px-8 py-3 flex items-center justify-between gap-3 backdrop-blur-md z-20 relative">
<div class="flex items-center gap-3">
<div class="p-1 bg-red-500 rounded-full">
<svg class="w-3 h-3 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>
</div>
<div>
<p class="text-[10px] font-black text-red-400 uppercase tracking-widest leading-none">CONTRAT REFUSÉ</p>
<p class="text-xs text-red-100/80 mt-1 font-medium italic">
Motif : "{{ contrat.refusedRaison|default('Aucune raison spécifiée') }}"
</p>
</div>
</div>
</div>
{% endif %}
{# --- BANNIÈRE DE LITIGE (Si signature EDL refusée) --- #}
{% if contrat.etatLieux and contrat.etatLieux.status == 'edl_return_refused' and not contrat.refused %}
<div class="bg-red-600/20 border-b border-red-500/30 px-8 py-3 flex items-center justify-between gap-3 backdrop-blur-md"> <div class="bg-red-600/20 border-b border-red-500/30 px-8 py-3 flex items-center justify-between gap-3 backdrop-blur-md">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<span class="relative flex h-3 w-3"> <span class="relative flex h-3 w-3">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span> <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-3 w-3 bg-red-500"></span> <span class="relative inline-flex rounded-full h-3 w-3 bg-red-500"></span>
</span> </span>
<div> <div>
<p class="text-[10px] font-black text-red-400 uppercase tracking-widest leading-none">⚠️ Litige : Signature refusée par le client</p> <p class="text-[10px] font-black text-red-400 uppercase tracking-widest leading-none">⚠️ Litige : Signature refusée par le client</p>
<p class="text-xs text-red-100/80 mt-1 font-medium italic"> <p class="text-xs text-red-100/80 mt-1 font-medium italic">
@@ -66,17 +83,21 @@
<div class="absolute -inset-px bg-gradient-to-r from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500 rounded-[2rem]"></div> <div class="absolute -inset-px bg-gradient-to-r from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500 rounded-[2rem]"></div>
<div class="relative bg-white/[0.03] border border-white/10 backdrop-blur-md rounded-[2rem] transition-all duration-300 group-hover:bg-white/[0.06] group-hover:translate-y-[-2px] group-hover:shadow-2xl group-hover:shadow-blue-500/10"> <div class="relative bg-white/[0.03] border border-white/10 backdrop-blur-md rounded-[2rem] transition-all duration-300 group-hover:bg-white/[0.06] group-hover:translate-y-[-2px] group-hover:shadow-2xl group-hover:shadow-blue-500/10 {{ contrat.refused ? 'opacity-50 grayscale' : '' }}">
<div class="grid grid-cols-1 lg:grid-cols-12 items-center"> <div class="grid grid-cols-1 lg:grid-cols-12 items-center">
{# 1. RÉFÉRENCE & STATUTS #} {# 1. RÉFÉRENCE & STATUTS #}
<div class="lg:col-span-2 p-8 border-b lg:border-b-0 lg:border-r border-white/5 text-center lg:text-left"> <div class="lg:col-span-2 p-8 border-b lg:border-b-0 lg:border-r border-white/5 text-center lg:text-left">
<span class="text-[10px] font-bold text-blue-400 uppercase tracking-[0.2em] mb-1 block">Réservation</span> <span class="text-[10px] font-bold text-blue-400 uppercase tracking-[0.2em] mb-1 block">Réservation</span>
<h3 class="text-white font-black text-xl tracking-tighter mb-3">{{ contrat.numReservation }}</h3> <h3 class="text-white font-black text-xl tracking-tighter mb-3 {{ contrat.refused ? 'line-through decoration-red-500/50' : '' }}">{{ contrat.numReservation }}</h3>
<div class="flex flex-col gap-2 items-center lg:items-start"> <div class="flex flex-col gap-2 items-center lg:items-start">
{# Status Contrat #} {# Status Contrat #}
{% if contrat.isSigned %} {% if contrat.refused %}
<div class="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-red-500/10 border border-red-500/20 text-red-400 text-[9px] font-bold uppercase tracking-wider">
<span class="w-1 h-1 rounded-full bg-red-500"></span> Refusé
</div>
{% elseif contrat.isSigned %}
<div class="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-[9px] font-bold uppercase tracking-wider"> <div class="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-[9px] font-bold uppercase tracking-wider">
<span class="w-1 h-1 rounded-full bg-emerald-500"></span> Contrat Signé <span class="w-1 h-1 rounded-full bg-emerald-500"></span> Contrat Signé
</div> </div>
@@ -207,11 +228,15 @@
class="w-full lg:w-12 h-12 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center text-white hover:bg-blue-600 hover:border-blue-400 transition-all group/btn" title="Consulter"> class="w-full lg:w-12 h-12 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center text-white hover:bg-blue-600 hover:border-blue-400 transition-all group/btn" title="Consulter">
<svg class="w-5 h-5 group-hover/btn:scale-110 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path></svg> <svg class="w-5 h-5 group-hover/btn:scale-110 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path></svg>
</a> </a>
<a data-turbo="false" href="{{ path('app_crm_contrats', {idSend: contrat.id}) }}"
onclick="return confirm('Renvoyer les documents à {{ contrat.customer.email }} ?')" {# Bouton Renvoyer Mail : Caché si signé OU refusé #}
class="w-full lg:w-12 h-12 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center text-white hover:bg-indigo-600 hover:border-indigo-400 transition-all group/btn" title="Renvoyer Mail"> {% if not contrat.isSigned and not contrat.refused %}
<svg class="w-5 h-5 group-hover/btn:translate-x-1 group-hover/btn:-translate-y-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path></svg> <a data-turbo="false" href="{{ path('app_crm_contrats', {idSend: contrat.id}) }}"
</a> onclick="return confirm('Renvoyer les documents à {{ contrat.customer.email }} ?')"
class="w-full lg:w-12 h-12 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center text-white hover:bg-indigo-600 hover:border-indigo-400 transition-all group/btn" title="Renvoyer Mail">
<svg class="w-5 h-5 group-hover/btn:translate-x-1 group-hover/btn:-translate-y-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path></svg>
</a>
{% endif %}
</div> </div>
</div> </div>
</div> </div>
@@ -223,6 +248,4 @@
{{ knp_pagination_render(contrats) }} {{ knp_pagination_render(contrats) }}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}