diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml index adf2ea14..fda6e316 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewQuoteds.cshtml @@ -4,7 +4,7 @@ @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @{ Layout = "_AdminLayout"; - ViewData["Title"] = "بازبینی مشق‌های شعر پیشنهادی"; + ViewData["Title"] = "بازبینی مشق‌شعرهای پیشنهادی"; }

@ViewData["Title"]

diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-QuotedPoems.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-QuotedPoems.cs index 85f9214b..a910c731 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-QuotedPoems.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-QuotedPoems.cs @@ -1,10 +1,12 @@ using DNTPersianUtils.Core; using Microsoft.EntityFrameworkCore; using RMuseum.DbContext; +using RMuseum.Models.Auth.Memory; using RMuseum.Models.Ganjoor; using RMuseum.Models.Ganjoor.ViewModels; using RSecurityBackend.Models.Generic; using RSecurityBackend.Models.Generic.Db; +using RSecurityBackend.Models.Notification; using RSecurityBackend.Services.Implementation; using System; using System.Collections.Generic; @@ -142,7 +144,7 @@ namespace RMuseum.Services.Implementation await _notificationService.PushNotification((Guid)dbQuoted.SuggestedById, "بررسی مشق شعر پیشنهادی شما", $"با سپاس از زحمت و همت شما مشق شعر پیشنهادیتان برای {dbQuoted.CachedRelatedPoemFullTitle} بررسی شد.{Environment.NewLine}" + - $"جهت مشاهدهٔ نتیجهٔ بررسی در میز کاربری خود بخش «مشق شعر‌های پیشنهادی من» را مشاهده بفرمایید.{Environment.NewLine}" + $"جهت مشاهدهٔ نتیجهٔ بررسی در میز کاربری خود بخش «مشق‌شعر‌های پیشنهادی من» را مشاهده بفرمایید.{Environment.NewLine}" ); return new RServiceResult(true); @@ -234,6 +236,22 @@ namespace RMuseum.Services.Implementation _context.Add(dbQuoted); await _context.SaveChangesAsync(); + var moderators = await _appUserService.GetUsersHavingPermission(RMuseumSecurableItem.GanjoorEntityShortName, RMuseumSecurableItem.ModerateOperationShortName); + if (string.IsNullOrEmpty(moderators.ExceptionString)) //if not, do nothing! + { + foreach (var moderator in moderators.Result) + { + await _notificationService.PushNotification + ( + (Guid)moderator.Id, + "پیشنهاد مشق شعر", + $"کاربری مشق شعری جدیدی را برای یک شعر پیشنهاد داده است. لطفاً بخش مشق‌ها را بررسی فرمایید.{Environment.NewLine}" + + $"توجه فرمایید که اگر کاربر دیگری که دارای مجوز بررسی مشق‌شعرهای پیشنهادی است پیش از شما به آن رسیدگی کرده باشد آن را در صف نخواهید دید.", + NotificationType.ActionRequired + ); + } + } + return new RServiceResult(new GanjoorQuotedPoemViewModel(dbQuoted)); }