Skip to content

feat: show reservation history on customer detail view#241

Merged
developeregrem merged 9 commits into
developeregrem:masterfrom
MeisterAdebar:feature/customer-reservation-history
Jun 13, 2026
Merged

feat: show reservation history on customer detail view#241
developeregrem merged 9 commits into
developeregrem:masterfrom
MeisterAdebar:feature/customer-reservation-history

Conversation

@MeisterAdebar

@MeisterAdebar MeisterAdebar commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Hi,

auch daran hab ich mich versucht und ist denk ich gut geworden 😎
#227 (comment)

  • Schnellübersicht aller Reservierungen eines Gasts direkt in Fewohbee ermöglichen? 🚧
    • Aktuell nur indirekt über DSGVO-Export möglich.
  • 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
Bildschirmfoto vom 2026-06-05 13-10-05

@MeisterAdebar MeisterAdebar force-pushed the feature/customer-reservation-history branch from 4f07327 to b051531 Compare June 5, 2026 11:31
- 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
@MeisterAdebar MeisterAdebar force-pushed the feature/customer-reservation-history branch from b051531 to b84f3aa Compare June 5, 2026 15:13
@developeregrem

Copy link
Copy Markdown
Owner

Sehr cool 👌🏻
Die Liste kann vermutlich auch sehr lang werden. Würde empfehlen dort eine pagination mit einzubauen.
Kannst dem Agent ja sagen er kann als Referenz das hier nehmen.

{% include 'paginator.html.twig' with {

- 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
@MeisterAdebar

Copy link
Copy Markdown
Contributor Author

Wenn man es mit Conflicts löst, wird das Modal bei jedem Seitenwechsel neu geladen.

Du hast recht – Alex meinte server-seitige Pagination wie bei Conflicts, nicht client-seitig. Der Unterschied: bei uns werden alle Reservierungen auf einmal geladen, bei Conflicts nur eine Seite.
Der Grund warum wir client-seitig gegangen sind: der Paginator-Link lädt das gesamte Modal neu statt nur den Accordion-Inhalt.
Aber schau nochmal wie Conflicts das löst – der Modal hat data-controller="reservations" direkt drauf und paginateImportReviewAction lädt via href neu in this.modalContent. Das Modal wird also komplett neu geladen – genau wie bei uns!
Der Unterschied zu unserem gescheiterten Versuch: wir haben modal-content-ajax als Target genutzt, aber Conflicts nutzt this.modalContent was dasselbe Element ist.
Frage: Stört dich das komplette Neu-Laden des Modals beim Seitenwechsel – oder war das technische Problem dass es nicht funktioniert hat?
Wenn nur das Neu-Laden stört → client-seitig (aktueller Stand) ist die bessere UX.
Wenn du es trotzdem server-seitig wie Alex vorgeschlagen haben möchtest → können wir es nochmal sauber implementieren, diesmal mit dem Wissen dass das Modal-Reload normal ist.

- ReservationRepository: distinct() + leftJoin invoices eager-loading
- customers_controller: requestAnimationFrame vor initReservationHistoryPagination
- customers_controller: alten #res-history-pager bei Modal-Reinjektion entfernen

@developeregrem developeregrem left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hab mich für drei entschieden.

</thead>
<tbody>
{% for res in reservations %}
<tr class="{{ res.reservationStatus and res.reservationStatus.id == 3 ? 'text-muted' : '' }}">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier hab ich den Abstand rausgenommen, weil das doof aussieht mit mt-3.

@developeregrem developeregrem merged commit 345e3e2 into developeregrem:master Jun 13, 2026
1 check passed
@MeisterAdebar MeisterAdebar deleted the feature/customer-reservation-history branch June 13, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants