-
Notifications
You must be signed in to change notification settings - Fork 3
Local SQLite storage layer (ILocalDataService) #122
Copy link
Copy link
Open
Description
Parent PRD
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 offlineIsDeleted(bool) — soft delete flag
Database lifecycle
- Initialized and migrated on app startup
LastSyncTimestampstored in MAUIPreferences
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
AzureStorageTestFixturepattern inNoteBookmark.Api.Tests
Acceptance Criteria
-
ILocalDataServiceinterface defined -
LocalDataServiceimplementation with sqlite-net-pcl - Schema includes
DateModified,IsPendingSync,IsDeleted - DB initialized on startup
- Integration tests pass
Offline stories from PRD
User stories 2, 3, 4, 5, 6
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Projects
Status
Backlog
Status
No status