105 Commits

Author SHA1 Message Date
Ulas Kalayci 761408ae7c fix: correct housekeeping module bugs after merge
- Restore migration order: remove spurious v30 birthday-reminders entry
  inserted before CardDAV (v30) and birthday-reminders (v31), which caused
  a duplicate v31 on fresh installs
- Restore birthdayReminderAt() offsetMin handling (regression from merge)
- Fix check-in INSERT: check_out was set to checkIn instead of NULL,
  making sessions invisible to loadOpenSession (IS NULL query)
- Implement check-out path in toggleSession() — only check-in was reachable
- Wrap GET /task-templates in try/catch per project convention
- Fix DELETE response envelopes: { ok: true } → { data: ... }
- Remove housekeeping worker exclusion from GET /auth/users
- Replace toISOString() with local-date helper to avoid UTC date shift
- Use user currency preference in money() instead of hardcoded BRL
- Replace hardcoded #7C3AED fallbacks in style attrs with CSS token
- Add German translations for documents folder and settings housekeeping keys
- Remove DESIGN.md and IMPLEMENTATION.md (AI planning artifacts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:18:26 +02:00
Rafael Foster 22ec13e559 feat: add housekeeping module for household staff management
* Adding flexible reminder options to birthdays

* Fix database migration merge conflict

* Truncate calendar popup descriptions

* Log app version on backend startup

* Add host-mounted data and backup folders

* feat: add housekeeping module

* fix: align housekeeping UI and add task creation

* refactor: rebuild housekeeping experience

* feat: support multiple housekeeping staff

* feat: integrate housekeeping visits with calendar

* feat: refine housekeeping visits and payments

* feat: add housekeeping staff visit logs

* feat: add housekeeping receipts and document folders

* feat: localize housekeeping folders and chores

* feat: refine housekeeping tabs and document folders

* fix: sync housekeeping tab active state

* feat: use configured app name in onboarding and manifest
2026-05-08 20:14:51 +02:00
Ulas Kalayci 2a48fb7af0 feat: multi-person assignment for tasks and calendar events
- DB migration v32: task_assignments and event_assignments join tables
  with CASCADE delete; existing assigned_to data migrated automatically
- Tasks API: accepts assigned_to as array, returns assigned_users[]
  with json_group_array; filter uses EXISTS on task_assignments
- Calendar API: same pattern via event_assignments; serializeEvent
  includes assigned_users array
- Recurring task completion copies all assignments to the new instance
- Frontend: shared UserMultiSelect component with avatar stack display
  (renderAvatarStack, renderUserMultiSelect, getSelectedUserIds,
  bindUserMultiSelect); tasks.js and calendar.js use it in modals
  and card/agenda views
- CSS: user-multi-select.css with avatar-stack and user-ms classes
- 14 new tests covering CRUD, JSON aggregation, EXISTS filter,
  and CASCADE behavior for both task and event assignments

Closes #125
2026-05-06 10:04:41 +02:00
Ulas Kalayci 82a1f2c239 feat: add flexible reminder options for birthdays
Add support for customizable birthday reminders with preset offsets
(none, at time, 15min, 1h, 1d, 2d, 1w, 2w) and custom intervals.
Users can now configure when to be reminded of upcoming birthdays.

- Add migration 31: reminder_offset, reminder_custom_amount, reminder_custom_unit to birthdays table
- Update POST/PUT /birthdays routes to accept reminder fields
- Add getOffsetMinutes() helper in birthday service
- Update birthdayReminderAt() to calculate reminder time with offset
- Modify syncBirthdayReminder() to handle empty offset (no reminder)
- Add renderBirthdayReminderSection() UI component
- Move reminder-custom CSS from calendar.css to reminders.css
- Add protocol check to service worker (non-http protocol guard)

All translations already present in de.json.
Tests: 109 passing, 0 failing.

Co-Authored-By: Rafael Foster <rafaelfoster@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 20:31:42 +02:00
Ulas Kalayci 0dc303b81a feat(contacts): add multi-value fields support to PUT /contacts/:id
Extend PUT /contacts/:id route to support updating phones, emails, and
addresses arrays with replacement semantics. Uses atomic transactions
to DELETE all existing multi-values then INSERT new ones. Validates
all multi-value fields before updating. Response includes full contact
with multi-value fields via loadMultiValueFields() helper.

Backward compatible: multi-value fields only replaced when present in
request body. Scalar fields (name, category, etc.) continue to work
independently.

Tests added:
- Update with multi-value fields (replacement semantics verified)
- Validation error on invalid phone data (400)
- Backward compatibility: update without multi-values preserves them

All 109 tests pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 18:31:01 +02:00
Ulas Kalayci 966a6d46e3 feat(contacts): add POST /contacts with multi-value fields
Implements Task 12: Extend POST /contacts to accept and persist phones,
emails, and addresses arrays. Uses atomic transactions to ensure all
related records are created together or rolled back on error.

- Validation: validatePhones/Emails/Addresses before insert
- Transaction: db.transaction() for atomic Contact + Multi-Values
- Backward compatible: Multi-value fields are optional
- Refactoring: Extracted loadMultiValueFields() helper (DRY)
- Response includes all multi-value fields with generated IDs

Tests: 3 new tests (create with multi-values, validation, backward compat)
TDD workflow: RED → GREEN → REFACTOR → Commit

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 18:25:18 +02:00
Ulas Kalayci fe8af33568 feat(contacts): add GET /contacts/:id with multi-value fields
Implements Task 11: Extend GET /contacts/:id to include phones, emails,
and addresses arrays. Each multi-value field is queried from its respective
table (contact_phones, contact_emails, contact_addresses) and mapped to
camelCase response format with isPrimary boolean conversion.

Tests: 2 new tests (contact with multi-values, empty arrays)
TDD workflow: RED → GREEN → Commit

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 18:18:07 +02:00
Ulas Kalayci 674fe796b3 feat(cardav): implement POST /accounts/:id/sync endpoint
Adds route to sync all enabled addressbooks for an account with mock support for tests.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:54:03 +02:00
Ulas Kalayci 9ec7fda6b0 feat(cardav): implement PUT /addressbooks/:id endpoint
Adds route to toggle addressbook enabled/disabled state with bool validation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:47:26 +02:00
Ulas Kalayci c078a48884 feat(cardav): implement POST /accounts/:id/addressbooks/refresh endpoint
Add addressbook refresh route. Loads account from DB, delegates to
CardDAVSync.discoverAddressbooks() to run PROPFIND, then returns
updated addressbook list from DB.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:13:14 +02:00
Ulas Kalayci 12e8edf4c3 feat(cardav): implement GET /accounts/:id/addressbooks endpoint
Add addressbook listing route. Queries carddav_addressbook_selection
table directly, ordered by name. Returns empty array if account has
no addressbooks.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:11:53 +02:00
Ulas Kalayci dd5ac8812c feat(cardav): implement POST /accounts/:id/test endpoint
Add connection test route. Loads account from DB and delegates to
CardDAVSync.testConnection() to verify credentials and discover
addressbooks without saving.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:10:25 +02:00
Ulas Kalayci ca92cb2a86 feat(cardav): implement DELETE /accounts/:id endpoint
Add account deletion route with ID validation. Delegates to
CardDAVSync.deleteAccount() which cascades to addressbooks and
contacts via foreign key constraints.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:04:39 +02:00
Ulas Kalayci f7eb73b835 feat(cardav): implement POST /accounts endpoint
Add account creation route with validation. Delegates to
CardDAVSync.addAccount() which creates account and discovers
addressbooks. Returns 201 with account + addressbooks array.

Add _mockTestConnection() helper for testing CardDAV routes without
real server connections.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 16:54:52 +02:00
Ulas Kalayci 930800eed9 fix(cardav): improve router security and test coverage
- Remove error message leakage (return generic 'Interner Fehler')
- Remove unused imports (str, collectErrors, MAX_TITLE, MAX_URL)
- Add _resetTestDatabase() for proper test cleanup
- Add test for populated accounts case with shape validation
- Import 'after' from node:test for proper teardown

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 16:51:21 +02:00
Ulas Kalayci cf68bff25f feat(cardav): create cardav router with GET /accounts
Add CardDAV API router with GET /accounts endpoint. Returns all
CardDAV accounts from database via cardav-sync service. Added test
infrastructure with _setTestDatabase helper for isolated API testing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 16:47:24 +02:00
Ulas Kalayci a71547562e feat(contacts): add multi-value array validators
Add validatePhones, validateEmails, validateAddresses for CardDAV
multi-value contact fields. Validates array structure, required
fields, type checks, and max lengths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 13:01:22 +02:00
Ulas Kalayci c5a9799983 feat(caldav): add calendar selection, sync, and API routes
- Add getCalendars() and updateCalendarSelection() to caldav-sync.js
- Add sync() function for bidirectional CalDAV synchronization
- Add getStatus() to report on all accounts and enabled calendars
- Add 8 new API routes to calendar.js for CalDAV account and calendar management
- All routes require admin role for security

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 08:32:46 +02:00
Ulas Kalayci 9b29d1847c feat: automatische geplante Backups mit Rotation
Phase 1.3 - Automatische Backups:
- Cron-basierter Scheduler (Standard: täglich 2 Uhr)
- Konfigurierbar über .env (Zeitplan, Verzeichnis, Anzahl)
- Automatische Rotation: behält nur letzte N Backups (Standard: 7)
- UI in Settings → Backup: Status-Anzeige und manueller Trigger
- Tests: 7 erfolgreiche Tests für Scheduler-Funktionalität

Neue Umgebungsvariablen:
- BACKUP_ENABLED (Standard: true)
- BACKUP_SCHEDULE (Standard: 0 2 * * *)
- BACKUP_DIR (Standard: ./backups)
- BACKUP_KEEP (Standard: 7)
- TZ (für Zeitzone)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 07:02:38 +02:00
Ulas Kalayci 99a2280c02 chore: release v0.42.0
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 06:52:35 +02:00
Ulas Kalayci f3dbbb37d7 fix: preserve dmy=DD.MM.YYYY, add dmy_slash for DD/MM/YYYY
The PR changed dmy from dots to slashes, breaking existing users.
Revert dmy to dots (backward compat), add dmy_slash for DD/MM/YYYY.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 15:28:18 +02:00
Rafael Foster f5377bd2f1 Improve dashboard widget sizing controls 2026-05-01 09:05:20 -03:00
Rafael Foster 9c5f8c9a99 Add dashboard widget customization 2026-05-01 08:53:25 -03:00
Rafael Foster e34ba33f9b Refine loan tab filtering and date formats 2026-05-01 08:24:39 -03:00
Rafael Foster 79f55cbfbc Improve loan dashboard interactions 2026-05-01 08:09:12 -03:00
Rafael Foster 977bee8a3a Separate budget and loan views 2026-05-01 07:52:43 -03:00
Rafael Foster ce107c80a4 Add budget loan tracking 2026-04-30 23:12:38 -03:00
Ulas Kalayci e59a9818a9 fix(i18n): add time format translations to all 13 missing locales
Also translate server error message to English and remove stale
comment from calendar.js catch block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 19:54:12 +02:00
Rafael Foster 8c9a5c6aa2 feat(settings): add time format preference 2026-04-30 13:48:35 -03:00
Rafael Foster 4aa9bc2a48 fix(calendar): tighten modal and attachment rendering 2026-04-29 22:44:25 -03:00
Rafael Foster 0cbd93e4e0 feat(settings): add database backup management 2026-04-29 14:04:04 -03:00
Rafael Foster d9218a4941 feat(calendar): add overlapping layout and event attachments 2026-04-29 08:53:07 -03:00
Rafael Foster 72fca92066 feat(documents): add family document management 2026-04-29 06:14:29 -03:00
Rafael Foster 9759f5e267 feat(tasks): add archived status support in API and schema 2026-04-29 05:33:06 -03:00
Rafael Foster 4d3c2688fe Prevent deletion of family members from contact list 2026-04-28 22:17:21 -03:00
Rafael Foster 69897666fb Refine family settings and calendar dentist icon 2026-04-28 20:28:50 -03:00
Rafael Foster 7b85db9b07 Sync family members with contacts and birthdays 2026-04-28 20:04:13 -03:00
Ulas Kalayci 6f8cc712a7 chore: release v0.30.3 2026-04-28 22:40:36 +02:00
Rafael Foster b4d74f239b Expand calendar event icon options 2026-04-27 22:22:30 -03:00
Rafael Foster 1d1d2291e5 Add calendar event icons and flexible date inputs 2026-04-27 21:38:06 -03:00
ulsklyc 19e6569281 fix(google-sync): skip null items and await initial sync (#93)
Null/undefined items in the Google Calendar API response caused a
TypeError on `item.status` access, silently aborting the sync while
the OAuth callback had already redirected to the success page.

- Filter null items in `upsertGoogleEvents` with an early `continue`
- Await `sync()` in the OAuth callback so errors surface as
  `sync_error=google` redirects instead of false success

Resolves #92

Co-authored-by: Ulas Kalayci <ulas.kalayci@googlemail.com>
2026-04-27 17:24:37 +02:00
Rafael Foster 7e4db48a9f Merge branch 'main' of github.com:rafaelfoster/oikos 2026-04-27 08:52:18 -03:00
Rafael Foster 6e410cb671 Add member editing and profile pictures 2026-04-27 08:09:00 -03:00
Rafael Foster b82a86c4b3 Add family roles to member management 2026-04-27 07:53:43 -03:00
Ulas Kalayci 6a575520aa chore: release v0.26.5 2026-04-27 12:51:10 +02:00
Ulas Kalayci 1821b7147a fix: path is not defined in renderPage and HAVING clause SQL error
- router.js: route-announcer used bare `path` variable which is not in scope
  inside renderPage(); replaced with `route.path`
- dashboard.js: shoppingLists query used `HAVING open_count > 0` without GROUP BY;
  SQLite rejects this — replaced with a WHERE subquery

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 12:24:39 +02:00
Rafael Foster 08199495b6 A lot of change in this commit. Changing the dashboard to get more data and the new features added 2026-04-26 21:18:59 -03:00
Rafael Foster 394b4ea84e Adding Birthday tracking feature - to compete with FamilyWall 2026-04-26 07:36:53 -03:00
Rafael Foster 112b05508b Adding /api/v1/budget/categories and /api/v1/budget/categories endpoints 2026-04-25 12:58:38 -03:00
Rafael Foster bdd6e559d5 Replacing entire backend messages (especially logs) with English instead of Germany 2026-04-25 10:56:46 -03:00