rumdood / Moneo

Telegram Bot for Managing Scheduled Tasks and Reminders
MIT License
2 stars 0 forks source link

Re-Work Data Model - Separate Tasks from Task-related Jobs #26

Open rumdood opened 6 months ago

rumdood commented 6 months ago

The original scope for this was just a glorified CRON job for sending reminders to take medication and a way to defuse the reminder. Things have grown way past that now and the data model is, frankly, a monstrosity.

Where there is a single entity being managed by Durable Entities, the model should be changed to contain separate models:

  1. Tasks: The actual things that need to be accomplished. Core fields include:
    • Task Id (unique id for the task, probably a UUID)
    • ConversationId (id of the conversation the task is associated with)
    • Task Name (the name given to the task when the user creates it
    • Task Description (possibly "LongName" - a longer description provided by the user. This might be better as a keyword list?)
    • DueDates (array of due dates)
    • CompletedHistory (array of date/times when the task has been completed)
    • SkippedHistory (array of date/times when the task has been skipped)
  2. Jobs: These are the scheduled messages sent on behalf of the task - the things that we need Durable Entities for. Core fields include:
    • Job Id
    • Task Id
    • Job Definition (probably a JSON object in case it's anything other than "send a message to the user")