=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -35,6 +35,7 @@ public class NoticeService(
|
||||
/// Deletes the specified notice by delegating to the ID-based deletion routine.
|
||||
/// </summary>
|
||||
/// <param name="notice">The notice to delete; its <c>Id</c> is used to identify the record to remove.</param>
|
||||
/// <!-- aidoc:v1 sig=8a4d223 body=3e9937f -->
|
||||
public async Task DeleteNoticeAsync(Notice notice)
|
||||
{
|
||||
await DeleteNoticeByIdAsync(notice.Id);
|
||||
@@ -44,6 +45,7 @@ public class NoticeService(
|
||||
/// Deletes a notice identified by its unique ID, creating an audit log entry and broadcasting the deletion when successful. If the notice is not found, the operation is logged and the method returns without making changes; any unexpected exception is logged without being rethrown.
|
||||
/// </summary>
|
||||
/// <param name="noticeId">The unique identifier of the notice to delete.</param>
|
||||
/// <!-- aidoc:v1 sig=fc4fef5 body=3b2109f -->
|
||||
public async Task DeleteNoticeByIdAsync(ObjectId noticeId)
|
||||
{
|
||||
try
|
||||
@@ -72,6 +74,7 @@ public class NoticeService(
|
||||
/// </summary>
|
||||
/// <param name="noticeId">The unique <see cref="ObjectId"/> of the notice to retrieve.</param>
|
||||
/// <returns>A <see cref="Notice"/> instance if found; otherwise, <c>null</c> when an exception is thrown during the search.</returns>
|
||||
/// <!-- aidoc:v1 sig=a29748d body=b9afac8 -->
|
||||
public async Task<Notice?> GetNoticeByIdAsync(ObjectId noticeId)
|
||||
{
|
||||
try
|
||||
@@ -92,6 +95,7 @@ public class NoticeService(
|
||||
/// <param name="noticeType">The type of notice to filter the search by.</param>
|
||||
/// <returns>A task that represents the asynchronous operation, containing a collection of <see cref="Notice"/> objects matching the specified type.</returns>
|
||||
/// <exception cref="NotFoundException">Thrown when no notices are found for the specified <paramref name="noticeType"/>.</exception>
|
||||
/// <!-- aidoc:v1 sig=f464ed9 body=32bab14 -->
|
||||
public async Task<IEnumerable<Notice>?> GetNoticeByTypeAsync(string noticeType)
|
||||
{
|
||||
return await noticeRepository.FindByType(noticeType) ??
|
||||
@@ -102,6 +106,7 @@ public class NoticeService(
|
||||
/// Retrieves all notices from the repository asynchronously.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of all <see cref="Notice"/> entities.</returns>
|
||||
/// <!-- aidoc:v1 sig=bb01c16 body=1c55179 -->
|
||||
public async Task<IEnumerable<Notice>> GetNoticesAsync()
|
||||
{
|
||||
return await noticeRepository.FindAll();
|
||||
@@ -112,6 +117,7 @@ public class NoticeService(
|
||||
/// </summary>
|
||||
/// <param name="notice">The notice to insert. A new identifier is assigned before persistence.</param>
|
||||
/// <returns>The inserted notice with its newly assigned identifier, or null if the operation fails.</returns>
|
||||
/// <!-- aidoc:v1 sig=3214327 body=e0c3682 -->
|
||||
public async Task<Notice?> InsertNotice(Notice notice)
|
||||
{
|
||||
try
|
||||
@@ -138,6 +144,7 @@ public class NoticeService(
|
||||
/// </summary>
|
||||
/// <param name="notice">The notice entity containing the updated data.</param>
|
||||
/// <exception cref="ConflictException">Thrown when the notice cannot be found in the repository.</exception>
|
||||
/// <!-- aidoc:v1 sig=b9bba8f body=19a0acb -->
|
||||
public async Task UpdateNoticeAsync(Notice notice)
|
||||
{
|
||||
try
|
||||
@@ -158,6 +165,7 @@ public class NoticeService(
|
||||
/// Processes an API request to create, update, or delete a notice based on the request type. Validates required fields for new and updated notices, skips processing when the notice or its description is missing, and logs any exceptions encountered.
|
||||
/// </summary>
|
||||
/// <param name="apiRequest">The API request containing the notice payload and the operation type (NewNotice, UpdateNotice, or DeleteNotice) to perform.</param>
|
||||
/// <!-- aidoc:v1 sig=229d8cd body=c1e382c -->
|
||||
public async Task SaveRequest(ApiRequest apiRequest)
|
||||
{
|
||||
try
|
||||
@@ -209,6 +217,7 @@ public class NoticeService(
|
||||
/// </summary>
|
||||
/// <param name="apiRequest">The API request to save.</param>
|
||||
/// <returns>A task that represents the asynchronous save operation.</returns>
|
||||
/// <!-- aidoc:v1 sig=a3706aa body=c8d77ba -->
|
||||
public Task SaveRequestAsync(ApiRequest apiRequest)
|
||||
{
|
||||
return Task.FromResult(Task.Run(async () => { await SaveRequest(apiRequest); }));
|
||||
@@ -220,6 +229,7 @@ public class NoticeService(
|
||||
/// </summary>
|
||||
/// <param name="displayId">The ObjectId of the display used to look up associated notices.</param>
|
||||
/// <returns>A task containing an <see cref="IEnumerable{T}"/> of <see cref="Notice"/> objects matching the display, or null if the operation fails.</returns>
|
||||
/// <!-- aidoc:v1 sig=0f1e6c7 body=ebcd280 -->
|
||||
public async Task<IEnumerable<Notice>?> GetNoticesByDisplayId(ObjectId displayId)
|
||||
{
|
||||
try
|
||||
@@ -239,6 +249,8 @@ public class NoticeService(
|
||||
/// </summary>
|
||||
/// <param name="notice">The notice to broadcast. Its <c>DisplayId</c> is used to resolve the target display and its subscribers.</param>
|
||||
/// <param name="operation">The operation type that identifies the kind of notice being broadcast and is forwarded to each subscriber.</param>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_summary
|
||||
/// "The summary states 'any exception thrown while sending is caught and logged,' but the SendAsync calls are invoked fire-and-forget (`_ = clientMessageService.SendAsync(...)`), so exceptions thrown within those tasks are not caught by this method's try/catch and would surface as unobserved task exceptions." -->
|
||||
private async void SendNoticeBroadcast(Notice notice, OperationType operation)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user