Commit Graph

94 Commits

Author SHA1 Message Date
richardtekula
f828af562d 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>
2025-12-15 07:03:29 +01:00
richardtekula
8770a98db8 feat: Add company linking to personal contacts
- Add companyId column to personal_contacts table
- Update personal-contact service to include companyName in list
- Add getContactsByCompanyId function for company contacts endpoint
- Add GET /companies/:companyId/contacts endpoint
- Add companyId to contact validation schema

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 08:03:29 +01:00
richardtekula
8656fb1db0 feat: Add creator info, team management for companies, and member access control
- Add creator info (username) to companies, projects, and notes responses
- Add company_users table for team management on companies
- Add resourceAccessMiddleware for member access control
- Members can only see resources they are directly assigned to
- Companies, projects, and todos are now filtered by user assignments
- Add personal contacts feature

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 07:41:57 +01:00
richardtekula
918af3a843 add contacts to crm & display on dashboard 2025-12-08 10:36:43 +01:00
richardtekula
38e2c5970a Fix: Translate remaining English log messages to Slovak
- validateInput.js: validation error messages
- errorHandler.js: unhandled error message
- validateBody.js: suspicious input message
- crm-email.controller.js: error log messages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:43:37 +01:00
richardtekula
4f4f53cbdc Fix: Remove problematic characters from temp password generation
- Remove special characters (!@#$%^&*) that cause login issues
- Remove ambiguous characters (I, O, l, i, o, 0, 1) for better readability
- Keep only alphanumeric characters for safe copy-paste and input

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:27:06 +01:00
richardtekula
176d3c5fec Refactor: Split jmap.service.js into modules and update Slovak translations
- Split 753-line jmap.service.js into modular structure:
  - jmap/config.js: JMAP configuration functions
  - jmap/client.js: Base JMAP requests (jmapRequest, getMailboxes, getIdentities)
  - jmap/discovery.js: Contact discovery from JMAP
  - jmap/search.js: Email search functionality
  - jmap/sync.js: Email synchronization
  - jmap/operations.js: Email operations (markAsRead, sendEmail)
  - jmap/index.js: Re-exports for backward compatibility

- Update all imports across codebase to use new module structure

- Translate remaining English error/log messages to Slovak:
  - email.service.js: JMAP validation messages
  - admin.service.js: Email account creation error
  - audit.service.js: Audit event logging error
  - timesheet.service.js: File deletion error
  - database.js: Database error message

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:11:41 +01:00
richardtekula
6f4a31e9de Code quality improvements from code review
- Add admin-only authorization for company and projects CRUD operations
- Create requireAccountId middleware to eliminate code duplication
- Standardize error handling (use next(error) consistently)
- Change error messages to Slovak language

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:03:32 +01:00
richardtekula
03b7a215bb Add server status monitoring endpoint
- Add status.service.js with CPU, RAM, Disk, Backend stats
- RAM calculation matches htop (reads /proc/meminfo)
- Includes uploads folder size, DB table count
- Returns both system and backend (process) uptime

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 09:00:31 +01:00
richardtekula
eb5582feb6 Add meetings feature with admin-only CRUD
- Add meetings table with timezone support
- Add meeting.service.js with timezone parsing (Europe/Bratislava)
- Add meeting.controller.js for CRUD operations
- Add meeting.routes.js with admin middleware for create/update/delete
- GET endpoints available for all authenticated users

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 08:17:23 +01:00
richardtekula
81f75d285e Refactor: code quality improvements
- Extract admin.service.js from admin.controller.js (proper layering)
- Remove console.log statements from todo.controller.js
- Fix inconsistent error handling in auth.controller.js (return next)
- Remove logger.debug calls from contact.controller.js
- Add transaction management to contact.service.js addContact()

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 07:25:49 +01:00
richardtekula
ad93b3b2a9 Fix: use correct function name for email account deletion 2025-12-04 11:46:13 +01:00
richardtekula
a49bff56da Add audit logging for CRUD operations
- Extend audit.service.js with logging functions for projects, todos, companies, time tracking, and auth
- Create audit.controller.js for fetching recent audit logs with user info
- Create audit.routes.js with GET /api/audit-logs endpoint
- Add audit logging to project, todo, company, time-tracking, and auth controllers
- Log create/delete operations for projects, todos, companies
- Log timer start/stop for time tracking
- Log login/logout events

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 10:41:30 +01:00
richardtekula
fa7129a5b4 Clean up: Remove documentation files
- Remove DOKUMENTACIA.md
- Remove SECURITY_CHECK.md
- Clean up README.md

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 10:27:34 +01:00
richardtekula
7adb92503a Expose notes route and running timers endpoint 2025-12-04 07:41:31 +01:00
richardtekula
35dfa07668 Improve centralized error handling 2025-12-04 07:39:52 +01:00
richardtekula
109cae1167 Security improvements, role in user creation, todo filters fix
- Remove better-auth dependency (unused)
- Update JWT secrets to stronger values
- Add ENCRYPTION_SALT env variable for password encryption
- Add role field to createUserSchema validator
- Accept role from body in admin.controller createUser
- Fix todo filters: add priority filter, handle completed param
- Remove .env.example (merged into .env)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 09:54:03 +01:00
richardtekula
ba11af5773 test-deploy 2025-12-02 09:48:42 +01:00
richardtekula
ffaf916f5e Add dueDate to reminders, remove reminder from notes
Schema changes:
- Added dueDate field to companyReminders table
- Removed reminderDate and reminderSent from notes table

Backend changes:
- Updated company-reminder.service with dueDate handling
- Added getUpcomingReminders function for dashboard
- Simplified note.service (removed reminder logic)
- Updated validators and routes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 11:21:54 +01:00
richardtekula
947d1d9b99 notification about emails in company card 2025-11-26 07:35:55 +01:00
richardtekula
879709661e add email threads to companies 2025-11-25 15:00:30 +01:00
richardtekula
cf4df9d314 add reminders notes and notification in sidebar 2025-11-25 11:29:03 +01:00
richardtekula
f4397bc0de Clean up duplicate schema definition
- Remove duplicate companyReminders table definition
- Add company isActive status feature
- Add company reminders feature

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 10:37:42 +01:00
richardtekula
d791de3834 Merge branch 'notif' - add company reminders feature 2025-11-25 10:28:22 +01:00
richardtekula
440585852d Add company reminders feature 2025-11-25 10:28:18 +01:00
richardtekula
9d5d42ee9f Add isActive column to companies table and update service 2025-11-25 10:01:04 +01:00
richardtekula
043eeccb77 fix generate excel in admin account 2025-11-25 09:27:11 +01:00
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