Skip to content

Conversation

manjencic
Copy link
Contributor

@manjencic manjencic commented Oct 14, 2025

Pull Request Checklist (Feature Branch to next):

  • Ich habe die neuesten Änderungen aus dem next Branch in meinen Feature-Branch gemergt.
  • Das Code-Review wurde abgeschlossen.
  • Fachliche Tests wurden durchgeführt und sind abgeschlossen.

Summary by CodeRabbit

  • Bug Fixes

    • Correct waiting number is now shown in the process view and on printed tickets.
    • Notification form now submits the correct waiting number.
  • Improvements

    • More accurate results when searching user accounts by department.
    • Access-controlled department lists behave more consistently.
  • Refactor

    • Internal optimizations reduce unnecessary processing and memory use for smoother performance.

@manjencic manjencic merged commit 4b0a848 into next Oct 14, 2025
87 checks passed
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adjusts user account search and reference resolution logic, removes cloning in department access filtering, and switches templates to use process.queue.number instead of process.displayNumber. Minor refactor in API search chain. No public interfaces changed.

Changes

Cohort / File(s) Summary of changes
API: User search by department
zmsapi/src/Zmsapi/UseraccountSearchByDepartment.php
Removed chained withLessData() on readSearchByDepartmentId(...) result; returns collection directly for subsequent withAccessByWorkstation(...).
DB: Useraccount reference resolution
zmsdb/src/Zmsdb/Useraccount.php
In readCollectionByDepartmentIds: conditionally populates entity->departments with readAssignedDepartmentList when resolveReferences>0 and id exists (using resolveReferences-1), then adds the entity. Removed a TODO in readResolvedReferences.
Entities: DepartmentList access filtering
zmsentities/src/Zmsentities/Collection/DepartmentList.php
withAccess no longer clones collection or department items; returns $this when organisation rights apply and adds actual $department instances when allowed.
Templates: Waiting number source update
zmsticketprinter/templates/block/content/print.twig, zmsticketprinter/templates/page/process.twig
Replaced process.displayNumber with process.queue.number in display and hidden input value.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor UI as UI
  participant API as Zmsapi.UseraccountSearchByDepartment
  participant DB as Zmsdb.Useraccount
  participant Ent as DepartmentList

  UI->>API: searchByDepartment(deptId, resolveReferences)
  API->>DB: readCollectionByDepartmentIds(deptId, resolveReferences)
  loop for each user
    alt resolveReferences > 0 and user.id
      DB->>DB: readAssignedDepartmentList(user.id, resolveReferences-1)
      DB->>DB: user.departments = result
    end
    DB-->>API: add user to collection
  end
  API->>Ent: withAccessByWorkstation(...)
  Note right of API: API no longer applies withLessData() before access filtering
  API-->>UI: filtered user collection
Loading
sequenceDiagram
  autonumber
  actor Kiosk as Ticket Printer UI
  participant Tmpl as Twig Templates

  Kiosk->>Tmpl: render process page/print block
  Tmpl->>Tmpl: resolve waiting number = process.queue.number
  Tmpl-->>Kiosk: HTML with updated waiting number binding
  Note over Tmpl: Replaces prior process.displayNumber usage
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • Fabinatix97

Poem

A hop, a skip, I tweak the queue—
From display digits to the queue that’s true.
Departments kept without a clone,
References trimmed, yet clearly shown.
I thump the ground: “All set to run!”
🥕 Numbers in line, reviews begun.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1894045 and e86b9c7.

📒 Files selected for processing (5)
  • zmsapi/src/Zmsapi/UseraccountSearchByDepartment.php (1 hunks)
  • zmsdb/src/Zmsdb/Useraccount.php (1 hunks)
  • zmsentities/src/Zmsentities/Collection/DepartmentList.php (1 hunks)
  • zmsticketprinter/templates/block/content/print.twig (1 hunks)
  • zmsticketprinter/templates/page/process.twig (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant