feat: Add dueDate (date+time) to notes and update reminders to datetime

- Add dueDate timestamp field to notes schema
- Update note validators to accept dueDate
- Update note service to handle dueDate in CRUD operations
- Fix company and project controllers to pass dueDate
- Fix route validations to include dueDate field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2025-12-15 07:03:29 +01:00
parent 8770a98db8
commit f828af562d
7 changed files with 30 additions and 12 deletions

View File

@@ -210,7 +210,7 @@ export const todoUsers = pgTable('todo_users', {
todoUserUnique: unique('todo_user_unique').on(table.todoId, table.userId),
}));
// Notes table - poznámky (bez reminder funkcionalít)
// Notes table - poznámky s voliteľným dátumom a časom splnenia
export const notes = pgTable('notes', {
id: uuid('id').primaryKey().defaultRandom(),
title: text('title'),
@@ -219,6 +219,7 @@ export const notes = pgTable('notes', {
projectId: uuid('project_id').references(() => projects.id, { onDelete: 'cascade' }), // alebo projektu
todoId: uuid('todo_id').references(() => todos.id, { onDelete: 'cascade' }), // alebo todo
contactId: uuid('contact_id').references(() => contacts.id, { onDelete: 'cascade' }), // alebo kontaktu
dueDate: timestamp('due_date'), // voliteľný dátum a čas splnenia (24h formát)
createdBy: uuid('created_by').references(() => users.id, { onDelete: 'set null' }),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),