Skip to content

feat: DateModified + delta API endpoints (#121)#130

Merged
fboucher merged 3 commits intov-nextfrom
squad/121-date-modified-delta-api
Apr 4, 2026
Merged

feat: DateModified + delta API endpoints (#121)#130
fboucher merged 3 commits intov-nextfrom
squad/121-date-modified-delta-api

Conversation

@fboucher
Copy link
Copy Markdown
Owner

@fboucher fboucher commented Apr 4, 2026

Summary

Adds DateModified (UTC timestamp) to Post and Note domain models, and extends GET list endpoints with an optional modifiedAfter query parameter for mobile delta sync.

Changes

Domain

  • Post.DateModifiedDateTime UTC, defaults to DateTime.UtcNow (Azure SDK requires UTC)
  • Note.DateModifiedDateTime UTC, set in constructor
  • PostL.DateModified — exposed in list responses

API

  • GET /api/posts/?modifiedAfter={ISO8601} — filters unread posts by DateModified (non-breaking)
  • GET /api/posts/read?modifiedAfter={ISO8601} — filters read posts by DateModified (non-breaking)
  • GET /api/notes/?modifiedAfter={ISO8601} — filters notes by DateModified (non-breaking)
  • PATCH /api/posts/{id} — updates post, sets DateModified = DateTime.UtcNow
  • PATCH /api/notes/note/{rowKey} — updates note, sets DateModified = DateTime.UtcNow

Storage

  • DataStorageService.SavePost sets DateModified = DateTime.UtcNow on every write
  • DataStorageService.CreateNote sets DateModified = DateTime.UtcNow on every write
  • In-memory filtering used for modifiedAfter (safe across all Azure Table Storage tiers)

Tests

  • 12 new endpoint integration tests in DeltaApiTests.cs
  • All 20 delta tests pass (8 Biggs proactive integration tests + 12 new endpoint tests)
  • No pre-existing tests broken

Closes #121

fboucher and others added 3 commits April 4, 2026 15:30
8 integration tests documenting the expected modifiedAfter filter contract
for Issue #121 (DateModified on Post/Note + delta query param).

Posts (GET /api/posts/?modifiedAfter=):
- ReturnsOnlyRecentPosts
- FutureTimestamp_ReturnsEmpty
- WithoutModifiedAfter_ReturnsAllPosts (non-breaking baseline)
- MultipleResults (3 posts, threshold filters to 2)

Notes (GET /api/notes/?modifiedAfter=):
- Same 4 patterns

Tests are intentionally RED until Han's implementation lands.
Timing-based seeding: Task.Delay(150ms) + DateTime.UtcNow threshold
ensures the server clock reliably separates old vs new entities.
Assertions use RowKey presence/absence for test isolation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add DateModified (DateTime UTC) to Post, Note, PostL domain models
- Post.DateModified defaults to DateTime.UtcNow to ensure valid UTC for Azure SDK
- Note constructor sets DateModified = DateTime.UtcNow
- DataStorageService.SavePost and CreateNote set DateModified = DateTime.UtcNow on every write
- GET /api/posts/?modifiedAfter={ISO8601} filters unread posts by DateModified (non-breaking)
- GET /api/posts/read?modifiedAfter={ISO8601} filters read posts by DateModified (non-breaking)
- GET /api/notes/?modifiedAfter={ISO8601} filters notes by DateModified (non-breaking)
- PATCH /api/posts/{id} endpoint added — updates post and refreshes DateModified
- PATCH /api/notes/note/{rowKey} endpoint added — updates note and refreshes DateModified
- 12 new integration tests in DeltaApiTests covering modifiedAfter filtering and PATCH semantics
- All 20 delta tests pass (8 Biggs proactive + 12 new endpoint tests)

Closes #121

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Code Coverage

Package Line Rate Branch Rate Health
NoteBookmark.AIServices 97% 64%
NoteBookmark.Api 91% 80%
NoteBookmark.BlazorApp 1% 2%
NoteBookmark.Domain 86% 75%
NoteBookmark.ServiceDefaults 96% 75%
NoteBookmark.SharedUI 7% 8%
Summary 53% (858 / 1608) 43% (201 / 467)

@fboucher fboucher merged commit b400843 into v-next Apr 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant