feat: show reservation history on customer detail view#241
Conversation
4f07327 to
b051531
Compare
- Add loadAllReservationsForCustomer() to ReservationRepository covers booker and guest role, ordered by startDate DESC - Inject ReservationRepository into getCustomerAction - Display reservation history accordion in customer_form_show modal with dates, nights, apartment, reservation status, invoice number with color-coded payment status and direct link to reservation modal
b051531 to
b84f3aa
Compare
|
Sehr cool 👌🏻 |
- initReservationHistoryPagination() in customers_controller.js triggered via onSuccess callback after modal load - shows 10 reservations per page, pagination rendered in accordion without reloading the modal
|
Wenn man es mit Conflicts löst, wird das Modal bei jedem Seitenwechsel neu geladen.
|
- ReservationRepository: distinct() + leftJoin invoices eager-loading - customers_controller: requestAnimationFrame vor initReservationHistoryPagination - customers_controller: alten #res-history-pager bei Modal-Reinjektion entfernen
developeregrem
left a comment
There was a problem hiding this comment.
Geefällt mir schon gut. Auch hier noch zwei Anmerkungen.
| class="accordion-collapse collapse" | ||
| aria-labelledby="reservationHistoryHeading" | ||
| data-bs-parent="#reservationHistoryAccordion"> | ||
| <div class="accordion-body p-0"> |
There was a problem hiding this comment.
Ich würde im accordion-body noch einen kleinen Abstand zum header machen, sonst klebt die Tabelle optisch direkt am header. mt-2 oder 3 könnte man setzen.
There was a problem hiding this comment.
Hab mich für drei entschieden.
| </thead> | ||
| <tbody> | ||
| {% for res in reservations %} | ||
| <tr class="{{ res.reservationStatus and res.reservationStatus.id == 3 ? 'text-muted' : '' }}"> |
There was a problem hiding this comment.
Die Bedingung nach reservationStatus kannst du hier leider nicht machen. Den kann ja jeder selbst definieren in den Einstellungen. ID 3 bei dir heißt nicht 3 bei einem anderen Nutzer, 3 kann auch gar nicht existieren.
Wenn du hier Storniert / No-Show meinst wäre das besser so hier:
res.reservationStatus and res.reservationStatus.code == 'canceled_noshow'
Bei mir ist das z.B. die ID 6, daher ist der Vergleich mit IDs. nicht stabil.
Storniert Status ist der einzige Systemstatus, der immer existiert, aber kann eben überall eine andere ID haben.
There was a problem hiding this comment.
Habs geändert.
- use reservationStatus.code == 'canceled_noshow' instead of id == 3 for stable cancelled status detection across different installations - remove mt-3 from outer row div - add mt-3 to accordion-body for better inner spacing
| @@ -0,0 +1,81 @@ | |||
| <div class="row mt-3"> | |||
There was a problem hiding this comment.
Hier hab ich den Abstand rausgenommen, weil das doof aussieht mit mt-3.
Hi,
auch daran hab ich mich versucht und ist denk ich gut geworden 😎
#227 (comment)