Commit Graph

117 Commits

Author SHA1 Message Date
richardtekula
31297ee9a9 refractoring & add timesheet service 2025-11-25 07:52:31 +01:00
richardtekula
125e30338a add many to one in todo, fix bugs, notification about todos 2025-11-24 11:30:25 +01:00
richardtekula
8fd8f991e8 Implement many-to-many TODO user assignments
- Create todo_users junction table for many-to-many relationship
- Add migration to create todo_users table and migrate existing data
- Update validators to accept assignedUserIds array instead of assignedTo
- Update todo service to handle multiple user assignments
- Fetch and return assigned users with each TODO

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 11:17:28 +01:00
richardtekula
7fd6b9e742 excel preview & file handling 2025-11-24 10:18:28 +01:00
richardtekula
dfcf8056f3 add time tracker with stats 2025-11-24 09:10:04 +01:00
richardtekula
540c1719d3 Add Time Tracking backend API
Implementovaný kompletný backend pre time tracking:
- Nová tabuľka time_entries s foreign keys na users, projects, todos, companies
- Service layer s business logikou pre CRUD operácie
- Controller pre všetky endpointy
- Validačné schémy pomocou Zod
- Routes s autentifikáciou a validáciou
- Endpointy:
  * POST /api/time-tracking/start - Spustenie timeru
  * POST /api/time-tracking/:id/stop - Zastavenie timeru
  * GET /api/time-tracking/running - Získanie bežiaceho záznamu
  * GET /api/time-tracking/month/:year/:month - Mesačné záznamy
  * GET /api/time-tracking/stats/monthly/:year/:month - Mesačné štatistiky
  * PATCH /api/time-tracking/:id - Aktualizácia záznamu
  * DELETE /api/time-tracking/:id - Zmazanie záznamu
- Podpora pre isEdited flag pri editácii
- Kalkulácia duration v minútach

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 06:41:39 +01:00
richardtekula
ca93b6f2d2 fix email issues, add company,project,todos 2025-11-21 13:56:02 +01:00
richardtekula
bb851639b8 Add Timesheets API with file upload and role-based access
Backend Features:
- Timesheets database table (id, userId, fileName, filePath, fileType, fileSize, year, month, timestamps)
- File upload with multer (memory storage, 10MB limit, PDF/Excel validation)
- Structured file storage: uploads/timesheets/{userId}/{year}/{month}/
- RESTful API endpoints:
  * POST /api/timesheets/upload - Upload timesheet
  * GET /api/timesheets/my - Get user's timesheets (with filters)
  * GET /api/timesheets/all - Get all timesheets (admin only)
  * GET /api/timesheets/:id/download - Download file
  * DELETE /api/timesheets/:id - Delete timesheet
- Role-based permissions: users access own files, admins access all
- Proper error handling and file cleanup on errors
- Database migration for timesheets table

Technical:
- Uses req.user.role for permission checks
- Automatic directory creation for user/year/month structure
- Blob URL cleanup and proper file handling
- Integration with existing auth middleware

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 08:35:30 +01:00
richardtekula
05be898259 Mark emails as read on JMAP server (fixes Betterbird showing unread) 2025-11-20 08:15:43 +01:00
richardtekula
4159a2aadb Add script to fix duplicate contacts in database 2025-11-20 08:05:27 +01:00
richardtekula
a1e9936a3f Fix markContactEmailsAsRead to match by email address and fix duplicate contact IDs 2025-11-20 08:05:02 +01:00
richardtekula
ed8875c00e Add comprehensive debug logging for markContactEmailsAsRead to diagnose contactId mismatch 2025-11-20 08:03:35 +01:00
richardtekula
178b18baa5 Add debug logging for markContactEmailsAsRead and remove password change restriction 2025-11-20 08:00:14 +01:00
richardtekula
51714c8edd update docs 2025-11-19 13:21:34 +01:00
richardtekula
1e7c1eab90 option for more emails,fix jmap service,add table email accounts 2025-11-19 13:15:45 +01:00
richardtekula
97f437c1c4 add searching, total unread message, create user 2025-11-19 08:45:37 +01:00
richardtekula
da01d586fc initialize git, basic setup for crm 2025-11-18 13:53:28 +01:00