Add TeamMeetingHistory entity, service, and UI components for meeting history management
This commit introduces the TeamMeetingHistory entity, including its configuration and database migrations. A new ITeamMeetingHistoryService interface and its implementation, TeamMeetingHistoryService, are added to handle CRUD operations for meeting histories. Additionally, UI components such as History.razor, MeetingHistoryDetailDialog, and SaveMeetingHistoryDialog are created to facilitate viewing and saving meeting histories. The integration of INoteNamingService enhances note management for meeting records, improving overall functionality and user experience in the application.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Core.Entities;
|
||||
|
||||
public class TeamMeetingHistory
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Meeting Date")]
|
||||
public DateTime MeetingDate { get; set; }
|
||||
|
||||
// Navigation properties
|
||||
public List<Team> Teams { get; set; } = [];
|
||||
public List<Student> Students { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Service for managing note naming conventions throughout the system.
|
||||
/// Centralizes the logic for generating note titles for meeting notes and page notes.
|
||||
/// </summary>
|
||||
public interface INoteNamingService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the title for a meeting note based on the meeting date.
|
||||
/// Format: "#Meeting Notes MM/dd/yyyy"
|
||||
/// </summary>
|
||||
/// <param name="meetingDate">The date of the meeting</param>
|
||||
/// <returns>The formatted meeting note title</returns>
|
||||
string GetMeetingNoteTitle(DateTime meetingDate);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title for a page note based on the page identifier.
|
||||
/// Format: "#{pageIdentifier}"
|
||||
/// </summary>
|
||||
/// <param name="pageIdentifier">The page identifier (e.g., "students", "teams")</param>
|
||||
/// <returns>The formatted page note title</returns>
|
||||
string GetPageNoteTitle(string pageIdentifier);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a note title represents a page note (starts with "#").
|
||||
/// </summary>
|
||||
/// <param name="noteTitle">The note title to check</param>
|
||||
/// <returns>True if the note is a page note, false otherwise</returns>
|
||||
bool IsPageNote(string noteTitle);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a note title represents a meeting note (starts with "#Meeting Notes").
|
||||
/// </summary>
|
||||
/// <param name="noteTitle">The note title to check</param>
|
||||
/// <returns>True if the note is a meeting note, false otherwise</returns>
|
||||
bool IsMeetingNote(string noteTitle);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Implementation of INoteNamingService that provides note naming conventions.
|
||||
/// Uses "#" as the prefix for page notes and meeting notes.
|
||||
/// </summary>
|
||||
public class NoteNamingService : INoteNamingService
|
||||
{
|
||||
private const string PageNotePrefix = "#";
|
||||
private const string MeetingNotePrefix = "#Meeting Notes";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string GetMeetingNoteTitle(DateTime meetingDate)
|
||||
{
|
||||
return $"{MeetingNotePrefix} {meetingDate:MM/dd/yyyy}";
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string GetPageNoteTitle(string pageIdentifier)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(pageIdentifier))
|
||||
{
|
||||
throw new ArgumentException("Page identifier cannot be null or empty", nameof(pageIdentifier));
|
||||
}
|
||||
|
||||
return $"{PageNotePrefix}{pageIdentifier}";
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsPageNote(string noteTitle)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(noteTitle))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return noteTitle.StartsWith(PageNotePrefix, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsMeetingNote(string noteTitle)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(noteTitle))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return noteTitle.StartsWith(MeetingNotePrefix, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user