Skip to content

Enhance slot caching and improve appointment availability logic#116

Merged
emmanuel-mwendwa merged 6 commits into
developfrom
hotfix-cache
May 26, 2026
Merged

Enhance slot caching and improve appointment availability logic#116
emmanuel-mwendwa merged 6 commits into
developfrom
hotfix-cache

Conversation

@emmanuel-mwendwa

Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the caching and persistence mechanisms for reference data and booking workflow state in the booking desk application. The changes focus on optimizing data retrieval with versioned in-memory caching, modernizing store persistence, and ensuring cache invalidation is handled consistently after mutations. Additionally, the legacy booking store persistence is retired in favor of a more robust workflow store approach.

Reference Data Caching and API Improvements:

  • Introduced versioned in-memory caching for service types and providers, using a new cacheVersion.api.js module to fetch and track cache versions, ensuring that stale data is not used and reducing unnecessary API calls. (booking_desk/src/api/cacheVersion.api.js [1] booking_desk/src/api/services.api.js [2] [3] [4] booking_desk/src/api/provider.api.js [5] [6] [7]
  • Added caching for available genders and normalized the customer fetching logic to use the search endpoint, improving consistency and performance. (booking_desk/src/api/provider.api.js [1] booking_desk/src/api/services.api.js [2] booking_desk/src/services/services.service.js [3]

Booking Workflow Store Enhancements:

  • Replaced legacy booking store persistence with a more robust, versioned workflow store that tracks hydration time and enforces a maximum age for stored data. The workflow store now flags when revalidation is required and automatically reloads or clears the workflow as needed. (booking_desk/src/stores/bookingWorkflow.store.js [1] [2] [3] [4] [5] [6] booking_desk/src/composables/booking/useBookingWorkflow.js [7] booking_desk/src/composables/booking/guest-assignment/useGuestAssignment.js [8]
  • Retired the legacy booking store's localStorage persistence logic, simplifying the codebase and preventing conflicts with the new workflow store. (booking_desk/src/App.vue [1] booking_desk/src/stores/bookingStore.js [2] [3]

Cache Invalidation Improvements:

  • Ensured that after key booking and appointment actions, related in-memory caches are invalidated by tag, keeping dashboard and booking data up-to-date across the application. (booking_desk/src/stores/bookingWorkflow.store.js [1] [2] booking_desk/src/stores/appointmentDetails.store.js [3] [4]

API Parameter Handling:

  • Improved handling of the daysAhead parameter in availability APIs by sanitizing and validating input, preventing invalid requests and improving API robustness. (booking_desk/src/api/availability.api.js [1] [2]

These changes collectively improve application performance, reliability, and maintainability, especially around booking workflows and reference data freshness.

emmanuel-mwendwa and others added 6 commits May 26, 2026 21:17
@emmanuel-mwendwa emmanuel-mwendwa merged commit 958f5f3 into develop May 26, 2026
2 of 3 checks passed
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