Commit Graph

17 Commits

Author SHA1 Message Date
Ulas Kalayci fe0254e225 docs: update PROGRESS.md - all 15 tasks completed
Tasks 14-15 documentation:
- Task 14: OpenAPI routes documented (d0eb638)
- Task 15: CardDAV router mounted (8891097)

All 109 tests passing across 20 suites.
Implementation ready for final review and release.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 18:39:19 +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 9e346dca5f docs: update PROGRESS.md for Task 12 completion 2026-05-04 18:25:30 +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 859a205299 docs: update PROGRESS.md for Task 11 completion 2026-05-04 18:18:38 +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 6e02c9e5b6 docs: session 2 handoff - Tasks 9-10 complete, ready for Task 11
Session 2 Summary:
- Task 9: PUT /addressbooks/:id (toggle enabled/disabled)
- Task 10: POST /accounts/:id/sync (with _mockSyncAccount)
- 101 tests passing (16 suites)
- Ready for Task 11: GET /contacts/:id with multi-value fields

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:57:41 +02:00
Ulas Kalayci 112cf55e66 docs: update PROGRESS.md for completed Task 10
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:54:45 +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 f895776911 docs: update PROGRESS.md for completed Task 9
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:47:55 +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 749e6ac79b docs: update PROGRESS.md for Tasks 6-8 completion (session pause) 2026-05-04 17:36:57 +02:00
Ulas Kalayci 29646960fe docs: update PROGRESS.md for completed Task 5 2026-05-04 17:10:57 +02:00
Ulas Kalayci 38fa84c3d4 docs: update PROGRESS.md for completed Task 4 2026-05-04 17:05:14 +02:00
Ulas Kalayci 39f3db99f7 docs: update progress after completing tasks 1-3
Tasks completed:
- Task 1: Multi-value validators (validatePhones, validateEmails, validateAddresses)
- Task 2: CardDAV router setup (GET /accounts)
- Task 3: POST /accounts endpoint

Test infrastructure established:
- _setTestDatabase/_resetTestDatabase for DB mocking
- _mockTestConnection for CardDAV API mocking
- 91 tests passing

Next: Task 4 (DELETE /accounts/:id)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-04 17:01:35 +02:00
Ulas Kalayci 8f78ed6fa2 fix: Isolate Contact Merge Logic tests via suite-level before hook
All 4 previously interdependent tests now use shared aliceContact from
before() hook. 54/54 tests passing with full isolation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 12:32:15 +02:00
Ulas Kalayci 7bdf88f94c docs: add progress tracker for CardDAV implementation
Task #1 completed, Task #2 needs 4 test interdependency fixes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 12:08:38 +02:00