Parent PRD
#110
Depends on
#121 (needs updated Post/Note domain models with DateModified)
Summary
Implement the local offline storage layer for NoteBookmark.MauiApp using sqlite-net-pcl.
Interface
interface ILocalDataService
{
Task<List<Post>> GetPostsAsync();
Task<Post?> GetPostAsync(string id);
Task SavePostAsync(Post post);
Task SavePostsAsync(IEnumerable<Post> posts);
Task<List<Note>> GetNotesAsync();
Task<Note?> GetNoteAsync(string rowKey);
Task SaveNoteAsync(Note note);
Task<List<Post>> GetPendingSyncPostsAsync();
Task<List<Note>> GetPendingSyncNotesAsync();
Task MarkSyncedAsync(string id, bool isPost);
}
Local schema (mirrors domain models + sync fields)
DateModified (DateTime UTC)
IsPendingSync (bool) — true when written offline
IsDeleted (bool) — soft delete flag
Database lifecycle
- Initialized and migrated on app startup
LastSyncTimestamp stored in MAUI Preferences
Tests
- Use in-memory or temp-file SQLite DB
- Test: save a post/note → retrieve it → update it → soft-delete it → query pending sync records
- Follow existing
AzureStorageTestFixture pattern in NoteBookmark.Api.Tests
Acceptance Criteria
Offline stories from PRD
User stories 2, 3, 4, 5, 6
Parent PRD
#110
Depends on
#121 (needs updated Post/Note domain models with DateModified)
Summary
Implement the local offline storage layer for
NoteBookmark.MauiAppusing sqlite-net-pcl.Interface
Local schema (mirrors domain models + sync fields)
DateModified(DateTime UTC)IsPendingSync(bool) — true when written offlineIsDeleted(bool) — soft delete flagDatabase lifecycle
LastSyncTimestampstored in MAUIPreferencesTests
AzureStorageTestFixturepattern inNoteBookmark.Api.TestsAcceptance Criteria
ILocalDataServiceinterface definedLocalDataServiceimplementation with sqlite-net-pclDateModified,IsPendingSync,IsDeletedOffline stories from PRD
User stories 2, 3, 4, 5, 6