Online booking: consider session reserved numbers when assigning appointment numbers#20428
Online booking: consider session reserved numbers when assigning appointment numbers#20428OsaVS wants to merge 3 commits intodevelopmentfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughReserved appointment numbers are propagated from ServiceSession into created SessionInstance objects and integrated into appointment-number allocation and API booking availability calculations; DB-derived bill-session serials and session reserveNumbers are combined to determine released/next appointment numbers. ChangesReserved Appointment Numbers Flow
Sequence DiagramsequenceDiagram
participant ChannelBean
participant SessionInstance
participant ChannelService
participant Database
ChannelBean->>SessionInstance: setReserveNumbers(ss.getReserveNumbers())
Note over SessionInstance: reservedNumbers stored
ChannelService->>ChannelService: nextAvailableAppoinmentNumberForSession(session)
ChannelService->>ChannelService: build reserved Set from session.reserveNumbers
ChannelService->>ChannelService: increment nextNumber past reserved values
ChannelService->>Database: getAllBillSessionSerialNumbersForSessionInstance(ss)
Database-->>ChannelService: existing serial numbers
ChannelService->>ChannelService: getReleasedAppoinmentNumbersForApiBookings(ss, reservedNumbers)
ChannelService->>ChannelService: compute unavailable = DB serials ∪ reservedNumbers
ChannelService-->>ChannelService: return released numbers excluding unavailable
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/com/divudi/service/ChannelService.java`:
- Around line 377-378: Replace the current reserve-number parsing that calls
CommonFunctions.convertStringToIntegerList(session.getOriginatingSession().getReserveNumbers())
with a null-safe parse of the booking-time SessionInstance snapshot (not the
originating template): obtain the SessionInstance reserve string (e.g.,
session.getReserveNumbers() or the instance accessor used in this class), guard
against null or empty by normalizing to an empty list, call
CommonFunctions.convertStringToIntegerList on that safe value, and then create
the Set via new HashSet<>(reservedNumbersList); apply the same change to the
other occurrences around methods/blocks referenced near lines 1085-1087 and
1297-1301 to avoid NPEs and ensure instance-based behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4f45381b-ad0b-49c7-8351-8694f9df1241
📒 Files selected for processing (2)
src/main/java/com/divudi/ejb/ChannelBean.javasrc/main/java/com/divudi/service/ChannelService.java
Issue: Previously, session reserved numbers could be assigned for online bookings.
Expected: Session reserved numbers should not be assigned for online bookings.
Files Changed:
ChannelBeanwas modified to ensure reserved numbers are assigned whensessionInstances are created viaServiceSession.getAllBillSessionSerialNumbersForSessionInstance(), method defined to get theBillSession's serialNo` directly.Ensure that appointment number for online booking is not a reserved number.
ChannelService.saveBillItem()modified, because null pointer exception was caused asBIllItemId generation was changed.Summary by CodeRabbit
Bug Fixes
Performance