Updated the task view and backend to handle more like a routine

This commit is contained in:
2026-03-08 22:10:46 -04:00
parent 4161ff9513
commit 9d3a277f45
14 changed files with 405 additions and 147 deletions

View File

@@ -5,14 +5,24 @@
#include "types.hpp"
#include "user.hpp"
enum task_period_t : uint8
{
PERIOD_MORNING = 0x01, // bit 0
PERIOD_AFTERNOON = 0x02, // bit 1
PERIOD_EVENING = 0x04, // bit 2
PERIOD_ALL_DAY = 0x07 // all bits
};
struct task_t
{
uint16 id; // Auto-assigned (165535, 0 = empty slot)
uint8 user_id; // Owner (matches user_t.id)
char title[64]; // Task description
int64 due_date; // Unix timestamp (seconds)
bool completed; // Done flag
bool active; // Slot in use
char title[64]; // Task description
int64 due_date; // Unix timestamp (seconds) - used when recurrence is 0
uint16 id; // Auto-assigned (165535, 0 = empty slot)
uint8 user_id; // Owner (matches user_t.id)
uint8 recurrence; // Bitmask: bit0=Mon, bit1=Tue, ..., bit6=Sun. 0=none
uint8 period : 3; // Bitmask: bit0=Morning, bit1=Afternoon, bit2=Evening
bool completed : 1; // Done flag
bool active : 1; // Slot in use
};
constexpr int MAX_TASKS = 32;