Skip to content

Feature: Smart scheduling and conflict detection for new events #7

Description

@gorlix

Context

When users create events via the bot (e.g., using the /add command), they might not have their full calendar memorized or easily accessible. This can lead to accidentally scheduling a new task or meeting during a time slot that is already occupied.

Problem

The bot currently creates events without verifying the user's existing schedule. This lack of validation can lead to double-booked time slots, causing schedule conflicts and requiring manual fixes later.

Proposed Solution

Implement a pre-check "smart" mechanism in the event creation flow. Before finalizing and pushing the new event to Morgen, the bot should query the user's schedule for the requested time window. If an overlap is detected, the bot will warn the user and ask for explicit confirmation before proceeding.

Acceptance Criteria

  • During the /add flow, extract the precise start and end times (including timezone) of the proposed event.
  • Query the Morgen API to fetch existing events that overlap with this specific time range.
  • If no overlap is found, proceed with the event creation seamlessly.
  • If an overlap is detected, pause the creation and send a warning to the user (e.g., "⚠️ Conflict Detected: You already have '[Existing Event Name]' scheduled from [Start] to [End].").
  • Provide interactive buttons (e.g., "Create Anyway" / "Cancel") so the user can decide how to proceed.
  • Only execute the final API creation call if the user confirms or if no conflict exists.

Technical Notes

  • Busy vs. Free: Ensure the conflict check only flags events marked as "Busy". It should ideally ignore "Free" events (like all-day background reminders or holidays) so it doesn't block valid scheduling.
  • The time range query needs to be highly accurate to avoid false positives (e.g., an event ending exactly at 10:00 should not conflict with a new event starting exactly at 10:00).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions