Allow temporary inspection slots to be disabled

Objective

  • Let schedulers mark a temporary inspection slot as offered or not offered in the online scheduler, while keeping it available for internal scheduling.
  • Support cases where extra capacity is intended for office or dispatch use only and should not be bookable by customers online.
  • Preserve current behavior by default so existing temporary slots continue to be offered online unless explicitly turned off.

Background

  • Users want a way to enable or disable whether a temporary inspection slot is offered in the online scheduler. See the Slack report.
  • Temporary slots already exist as manual historic slots. They are created and updated through POST/PATCH routes in attik-backend/src/routes/slot.ts.
  • The online scheduler and internal scheduling currently share the same backend availability path. GET /schedule/optimal-slots merges historic slots with weekly template slots and is used by the online scheduler as well as staff scheduling flows.
  • Today, loadHistoricSlotsForScheduleDates loads all relevant historic slots in range without a per-slot visibility control for public booking.
  • The historic slot schema includes origin and series metadata, but no field that distinguishes offered online from internal-only availability.
  • The temporary slot UI also has no control for this behavior, so once a temporary slot exists it is eligible for online scheduling like any other available slot.
  • Code review confirmed this is a feature gap, not a bug.

Scope

Backend

  • Extend the historic slot model in attik-backend/src/models/slotsSchema.ts with a field that represents whether a temporary slot is offered in the online scheduler.
  • Update attik-backend/src/routes/slot.ts so manual temporary slot create and edit flows can persist that value for single slots and recurring temporary series.
  • Update attik-backend/src/util/functions/slots/historicSlotsForScheduling.ts so online availability excludes temporary/manual slots that are marked as not offered online.
  • Because optimal-slots is shared by online and internal callers, apply filtering based on request context rather than removing these slots globally from all scheduling flows.
  • The exact detection approach for online versus staff requests does not need to be decided in advance. The developer should choose the cleanest implementation path.

Frontend

  • Add an offered-online toggle to attik-frontend/src/app/tools/settings/inspectors/[id]/EditTemporarySlotModal.tsx when creating or editing temporary availability.
  • Show the slot’s offered-online state in attik-frontend/src/app/tools/settings/inspectors/[id]/TemporaryInspectorSlots.tsx, including a visible badge for internal-only slots.
  • Preserve existing online scheduler behavior for temporary slots unless a scheduler explicitly turns the setting off.

Recurring temporary series behavior

  • The offered-online setting should apply to the whole recurring temporary series.
  • When editing an existing recurring temporary series, the scheduler should be able to choose whether the change applies to:
  • only the selected occurrence, or
  • this and future occurrences

Out of scope

  • Per-slot online visibility for the recurring weekly template grid (Slots model). This work is limited to temporary/manual historic slots.
  • Hiding temporary slots from internal dispatch, calendar, or workorder reschedule flows.
  • Redesigning the broader online scheduler availability model beyond what is needed to support this slot-level control.

Decision needed

  • Field name and persisted shape for the online visibility flag.
  • Exact backend mechanism for distinguishing online-scheduler versus staff availability requests.
  • Whether slot-list UI should show only a badge, or additional filtering/sorting affordances later.

References

  • Slack report
  • Historic slot schema: attik-backend/src/models/slotsSchema.ts
  • Manual slot routes: attik-backend/src/routes/slot.ts
  • Availability loader: attik-backend/src/util/functions/slots/historicSlotsForScheduling.ts
  • Optimal slots API: attik-backend/src/routes/schedule.ts
  • Online scheduler slot fetch: attik-frontend/src/app/scheduler/slots/SlotsStep.tsx
  • Temporary slot UI: attik-frontend/src/app/tools/settings/inspectors/[id]/EditTemporarySlotModal.tsx

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

About 3 hours ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.