Add IsPinned and IsDeleted properties to Note entity with corresponding database configurations and migrations
This commit enhances the Note entity by introducing two new properties: IsPinned and IsDeleted, allowing for better management of note visibility and status. The NoteConfiguration class has been updated to include indexes for these properties, improving query performance. Additionally, new migrations have been created to reflect these changes in the database schema. The UI components have been updated to support pinning and restoring notes, enhancing user interaction and functionality within the note management system.
This commit is contained in:
@@ -5,15 +5,23 @@ namespace WebApp.Services;
|
||||
public interface INotesService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets all notes.
|
||||
/// Gets all notes, optionally including deleted notes.
|
||||
/// </summary>
|
||||
Task<IEnumerable<Note>> GetNotesAsync();
|
||||
/// <param name="includeDeleted">If true, includes soft-deleted notes. Defaults to false.</param>
|
||||
Task<IEnumerable<Note>> GetNotesAsync(bool includeDeleted = false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single note by ID.
|
||||
/// </summary>
|
||||
Task<Note?> GetNoteAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page-specific note by page identifier.
|
||||
/// </summary>
|
||||
/// <param name="pageIdentifier">The page identifier (e.g., "Teams", "Registration")</param>
|
||||
/// <returns>The note with title "@{pageIdentifier}" or null if not found</returns>
|
||||
Task<Note?> GetPageNoteAsync(string pageIdentifier);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all history entries for a note.
|
||||
/// </summary>
|
||||
@@ -33,4 +41,24 @@ public interface INotesService
|
||||
/// Deletes a note and creates a deletion history entry.
|
||||
/// </summary>
|
||||
Task DeleteNoteAsync(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets up to 3 pinned notes, excluding page notes and deleted notes, ordered by most recently updated.
|
||||
/// </summary>
|
||||
Task<IEnumerable<Note>> GetPinnedNotesAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the pin status of a note, enforcing the 3-note limit.
|
||||
/// </summary>
|
||||
Task TogglePinNoteAsync(int noteId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all soft-deleted notes.
|
||||
/// </summary>
|
||||
Task<IEnumerable<Note>> GetDeletedNotesAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Restores a soft-deleted note.
|
||||
/// </summary>
|
||||
Task RestoreNoteAsync(int noteId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user