https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41129

--- Comment #49 from Paul Derscheid <[email protected]> ---
Created attachment 200581
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200581&action=edit
Bug 41129: Add booking domain library and shared utilities

- Add lib/booking/BookingDate.js (immutable, timezone-aware date
  wrapper)
- Add lib/booking/availability/ (date-change, disabled-dates,
  period-validators, rules, unavailable-map) and the outer
  lib/booking/availability.js barrel
- Add lib/booking/algorithms/ (interval-tree, sweep-line-processor)
  for efficient overlap detection and unavailability computation
- Add lib/booking/ logic modules (conflict-resolution, constants,
  constraints, id-utils, markers, strategies, validation,
  validation-messages)
- Add lib/adapters/api/staff-interface.js and api/opac.js for the
  per-environment API surface, plus lib/adapters/{form, patron,
  globals, external-dependents}.js for the DOM/legacy shims
- Add lib/ui/ helpers (hover-feedback, marker-labels,
  selection-message, steps)
- Add types/ (bookings.d.ts, dayjs-plugins.d.ts, vue-shims.d.ts)
  and a Bookings-scoped tsconfig.json with allowJs / skipLibCheck
  and the @koha-vue path alias so vue-tsc reads JSDoc on the
  .js files directly
- Add vue/utils/apiErrors.js, validationErrors.js, dayjs.js and
  functions.js (shared across the module)
- Add Cypress component specs under t/cypress/component/lib/booking/
  for createDisableFunction, findFirstBlockingDate, IntervalTree
  and buildIntervalTree, buildUnavailableByDateMap with
  addHolidayMarkers, the period validators (calculateMaxEndDate,
  lead/trail/range-overlap, getAvailableItemsForPeriod), and the
  rules helpers (calculateMaxBookingPeriod, deriveEffectiveRules,
  extractBookingConfiguration); pure-function tests with no Vue
  mount so an algorithmic regression points here directly instead
  of cascading through the picker DOM

Test plan:
1. Run the pure-function component suites covering this library:
   npx cypress run --component --browser electron \
     --spec 't/cypress/component/lib/booking/**/*_spec.ts'
2. Nothing is wired into a page yet; the booking modal patch later
   in this series exercises the library end-to-end (see its test
   plan)

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Assisted-by: Opus 4.8 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to