ux(complaint): surface resolution_category and resolution_outcome in resolve modal

These fields already existed on the Complaint model and are read by
ComplaintService.change_status, but PX had to fill them via separate
endpoints after resolving. Now they're captured in the same modal as
the resolution text. Also fixed the view (complaint_change_status) to
extract resolution_category from POST and pass it to the service — the
service accepted the kwarg but the view never forwarded it.
This commit is contained in:
ismail 2026-07-20 22:26:05 +03:00
parent 85980f232b
commit c88c5cf973
2 changed files with 24 additions and 0 deletions

View File

@ -1589,6 +1589,7 @@ def complaint_change_status(request, pk):
new_status = request.POST.get("status") new_status = request.POST.get("status")
note = request.POST.get("note", "") note = request.POST.get("note", "")
resolution = request.POST.get("resolution", "") resolution = request.POST.get("resolution", "")
resolution_category = request.POST.get("resolution_category", "")
resolution_outcome = request.POST.get("resolution_outcome", "") resolution_outcome = request.POST.get("resolution_outcome", "")
resolution_outcome_other = request.POST.get("resolution_outcome_other", "") resolution_outcome_other = request.POST.get("resolution_outcome_other", "")
@ -1600,6 +1601,7 @@ def complaint_change_status(request, pk):
request=request, request=request,
note=note, note=note,
resolution=resolution, resolution=resolution,
resolution_category=resolution_category,
resolution_outcome=resolution_outcome, resolution_outcome=resolution_outcome,
resolution_outcome_other=resolution_outcome_other, resolution_outcome_other=resolution_outcome_other,
) )

View File

@ -961,6 +961,28 @@
<label class="block text-sm font-semibold text-slate mb-2">{% trans "Resolution Notes" %} <span class="text-red-500">*</span></label> <label class="block text-sm font-semibold text-slate mb-2">{% trans "Resolution Notes" %} <span class="text-red-500">*</span></label>
<textarea name="resolution" rows="4" class="w-full border border-slate-200 rounded-xl p-4 text-sm focus:ring-2 focus:ring-navy/20 outline-none" placeholder="{% trans 'Enter resolution details...' %}" required></textarea> <textarea name="resolution" rows="4" class="w-full border border-slate-200 rounded-xl p-4 text-sm focus:ring-2 focus:ring-navy/20 outline-none" placeholder="{% trans 'Enter resolution details...' %}" required></textarea>
</div> </div>
<div class="grid grid-cols-2 gap-3 mb-4">
<div>
<label class="block text-sm font-semibold text-slate mb-2">{% trans "Resolution Category" %}</label>
<select name="resolution_category" class="w-full border border-slate-200 rounded-xl p-3 text-sm focus:ring-2 focus:ring-navy/20 outline-none bg-white">
<option value="">{% trans "— Select —" %}</option>
<option value="full_action_taken">{% trans "Full action taken" %}</option>
<option value="partial_action_taken">{% trans "Partial action taken" %}</option>
<option value="no_action_needed">{% trans "No action needed" %}</option>
<option value="cannot_resolve">{% trans "Cannot resolve" %}</option>
<option value="patient_withdrawn">{% trans "Patient withdrawn" %}</option>
</select>
</div>
<div>
<label class="block text-sm font-semibold text-slate mb-2">{% trans "Resolution Outcome" %}</label>
<select name="resolution_outcome" class="w-full border border-slate-200 rounded-xl p-3 text-sm focus:ring-2 focus:ring-navy/20 outline-none bg-white">
<option value="">{% trans "— Select —" %}</option>
<option value="patient">{% trans "In favour of patient" %}</option>
<option value="hospital">{% trans "In favour of hospital" %}</option>
<option value="other">{% trans "Other" %}</option>
</select>
</div>
</div>
<div class="flex gap-3"> <div class="flex gap-3">
<button type="button" onclick="closeModal('resolveModal')" class="flex-1 px-4 py-2 border border-slate-200 text-slate rounded-xl font-semibold hover:bg-slate-50 transition"> <button type="button" onclick="closeModal('resolveModal')" class="flex-1 px-4 py-2 border border-slate-200 text-slate rounded-xl font-semibold hover:bg-slate-50 transition">
{% trans "Cancel" %} {% trans "Cancel" %}