NotificationType, Seeder ve List
This commit is contained in:
parent
96b78bd4b9
commit
8feab2184a
31 changed files with 530 additions and 166 deletions
|
|
@ -1,9 +1,11 @@
|
||||||
namespace Sozsoft.Notifications.NotificationRules;
|
using System;
|
||||||
|
|
||||||
|
namespace Sozsoft.Notifications.NotificationRules;
|
||||||
|
|
||||||
public class CreateUpdateNotificationRuleDto
|
public class CreateUpdateNotificationRuleDto
|
||||||
{
|
{
|
||||||
public string Channel { get; set; }
|
public string Channel { get; set; }
|
||||||
public string NotificationType { get; set; }
|
public Guid NotificationTypeId { get; set; }
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,10 @@ public interface INotificationRuleAppService : ICrudAppService<
|
||||||
PagedAndSortedResultRequestDto,
|
PagedAndSortedResultRequestDto,
|
||||||
CreateUpdateNotificationRuleDto>
|
CreateUpdateNotificationRuleDto>
|
||||||
{
|
{
|
||||||
string[] GetNotificationTypes();
|
Task<string[]> GetNotificationTypes();
|
||||||
Task<string[]> GetMyNotificationTypesAsync();
|
Task<string[]> GetMyNotificationTypesAsync();
|
||||||
Task<List<NotificationRuleDto>> GetMyNotificationRules();
|
Task<List<NotificationRuleDto>> GetMyNotificationRules();
|
||||||
Task PostMyNotificationRule(CreateUpdateNotificationRuleDto Input);
|
Task PostMyNotificationRule(CreateUpdateNotificationRuleDto Input);
|
||||||
Task DeleteMyNotificationRules(string NotificationType);
|
Task DeleteMyNotificationRules(Guid NotificationTypeId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace Sozsoft.Notifications.NotificationRules;
|
||||||
|
|
||||||
public class NotificationRuleDto : FullAuditedEntityDto<Guid>
|
public class NotificationRuleDto : FullAuditedEntityDto<Guid>
|
||||||
{
|
{
|
||||||
public string? NotificationType { get; set; }
|
public Guid? NotificationTypeId { get; set; }
|
||||||
public string? RecipientType { get; set; }
|
public string? RecipientType { get; set; }
|
||||||
public string? RecipientId { get; set; } //UserId, RoleId, OrganizationUnitId
|
public string? RecipientId { get; set; } //UserId, RoleId, OrganizationUnitId
|
||||||
public string? Channel { get; set; }
|
public string? Channel { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
using Volo.Abp.Application.Dtos;
|
||||||
|
|
||||||
|
namespace Sozsoft.Notifications.NotificationRules;
|
||||||
|
|
||||||
|
public class NotificationTypeDto : FullAuditedEntityDto<Guid>
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -57,10 +57,10 @@ public class NotificationAppService : ReadOnlyAppService<
|
||||||
|
|
||||||
public async Task CreateNotificationByNotificationRuleIdAsync(NotificationRequestDto input)
|
public async Task CreateNotificationByNotificationRuleIdAsync(NotificationRequestDto input)
|
||||||
{
|
{
|
||||||
var notificationRule = await repositoryRule.GetAsync(input.Id);
|
var notificationRule = await repositoryRule.GetAsync(input.Id, true);
|
||||||
if (notificationRule != null)
|
if (notificationRule != null)
|
||||||
{
|
{
|
||||||
await notificationManager.SendNotificationAsync(notificationRule.NotificationType, input.Message);
|
await notificationManager.SendNotificationAsync(notificationRule.NotificationTypeId, input.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ public class NotificationApplicationAutoMapperProfile : Profile
|
||||||
{
|
{
|
||||||
public NotificationApplicationAutoMapperProfile()
|
public NotificationApplicationAutoMapperProfile()
|
||||||
{
|
{
|
||||||
|
CreateMap<NotificationType, NotificationTypeDto>();
|
||||||
CreateMap<NotificationRule, NotificationRuleDto>();
|
CreateMap<NotificationRule, NotificationRuleDto>();
|
||||||
CreateMap<Notification, NotificationDto>()
|
CreateMap<Notification, NotificationDto>()
|
||||||
.ForMember(d => d.CreatorFullname, o => o.Ignore())
|
.ForMember(d => d.CreatorFullname, o => o.Ignore())
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Sozsoft.Notifications.Domain;
|
using Sozsoft.Notifications.Domain;
|
||||||
using Sozsoft.Notifications.Entities;
|
using Sozsoft.Notifications.Entities;
|
||||||
using Sozsoft.Notifications.Enums;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Volo.Abp.Application.Dtos;
|
using Volo.Abp.Application.Dtos;
|
||||||
|
|
@ -23,25 +22,30 @@ public class NotificationRuleAppService : CrudAppService<
|
||||||
CreateUpdateNotificationRuleDto>,
|
CreateUpdateNotificationRuleDto>,
|
||||||
INotificationRuleAppService
|
INotificationRuleAppService
|
||||||
{
|
{
|
||||||
|
private readonly IRepository<NotificationType, Guid> repositoryType;
|
||||||
|
private readonly IOrganizationUnitRepository repositoryOrganizationUnit;
|
||||||
private readonly IdentityUserManager userManager;
|
private readonly IdentityUserManager userManager;
|
||||||
private readonly IIdentityUserRepository repositoryUser;
|
private readonly IIdentityUserRepository repositoryUser;
|
||||||
private readonly IOrganizationUnitRepository repositoryOrganizationUnit;
|
|
||||||
|
|
||||||
public NotificationRuleAppService(
|
public NotificationRuleAppService(
|
||||||
|
IRepository<NotificationType, Guid> repositoryType,
|
||||||
IRepository<NotificationRule, Guid> repository,
|
IRepository<NotificationRule, Guid> repository,
|
||||||
IdentityUserManager userManager,
|
IdentityUserManager userManager,
|
||||||
IIdentityUserRepository repositoryUser,
|
IIdentityUserRepository repositoryUser,
|
||||||
IOrganizationUnitRepository repositoryOrganizationUnit
|
IOrganizationUnitRepository repositoryOrganizationUnit
|
||||||
) : base(repository)
|
) : base(repository)
|
||||||
{
|
{
|
||||||
|
this.repositoryType = repositoryType;
|
||||||
this.userManager = userManager;
|
this.userManager = userManager;
|
||||||
this.repositoryUser = repositoryUser;
|
this.repositoryUser = repositoryUser;
|
||||||
this.repositoryOrganizationUnit = repositoryOrganizationUnit;
|
this.repositoryOrganizationUnit = repositoryOrganizationUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string[] GetNotificationTypes()
|
public async Task<string[]> GetNotificationTypes()
|
||||||
{
|
{
|
||||||
return NotificationTypes.GetAll();
|
var types = await repositoryType.GetListAsync();
|
||||||
|
|
||||||
|
return types.Select(a => a.Name).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetAllParentCodes(string code, List<string>? codes)
|
private void GetAllParentCodes(string code, List<string>? codes)
|
||||||
|
|
@ -83,7 +87,8 @@ public class NotificationRuleAppService : CrudAppService<
|
||||||
public async Task<string[]> GetMyNotificationTypesAsync()
|
public async Task<string[]> GetMyNotificationTypesAsync()
|
||||||
{
|
{
|
||||||
var query = await CreateFilteredQueryAsync(new PagedAndSortedResultRequestDto());
|
var query = await CreateFilteredQueryAsync(new PagedAndSortedResultRequestDto());
|
||||||
return await query.Select(a => a.NotificationType).Distinct().ToArrayAsync();
|
|
||||||
|
return await query.Select(a => a.NotificationType.Name).Distinct().ToArrayAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<NotificationRuleDto>> GetMyNotificationRules()
|
public async Task<List<NotificationRuleDto>> GetMyNotificationRules()
|
||||||
|
|
@ -91,7 +96,7 @@ public class NotificationRuleAppService : CrudAppService<
|
||||||
var query = await CreateFilteredQueryAsync(new PagedAndSortedResultRequestDto());
|
var query = await CreateFilteredQueryAsync(new PagedAndSortedResultRequestDto());
|
||||||
var all = await query.ToListAsync();
|
var all = await query.ToListAsync();
|
||||||
var list = all
|
var list = all
|
||||||
.GroupBy(a => new { a.NotificationType, a.Channel })
|
.GroupBy(a => new { a.NotificationTypeId, a.Channel })
|
||||||
.Select(a =>
|
.Select(a =>
|
||||||
{
|
{
|
||||||
var item = a.FirstOrDefault(a => a.IsFixed)
|
var item = a.FirstOrDefault(a => a.IsFixed)
|
||||||
|
|
@ -101,7 +106,7 @@ public class NotificationRuleAppService : CrudAppService<
|
||||||
return new NotificationRuleDto
|
return new NotificationRuleDto
|
||||||
{
|
{
|
||||||
Id = item.Id,
|
Id = item.Id,
|
||||||
NotificationType = a.Key.NotificationType,
|
NotificationTypeId = a.Key.NotificationTypeId,
|
||||||
Channel = a.Key.Channel,
|
Channel = a.Key.Channel,
|
||||||
IsActive = item.IsActive,
|
IsActive = item.IsActive,
|
||||||
IsFixed = item.IsFixed,
|
IsFixed = item.IsFixed,
|
||||||
|
|
@ -121,13 +126,13 @@ public class NotificationRuleAppService : CrudAppService<
|
||||||
a.RecipientId == CurrentUser.UserName &&
|
a.RecipientId == CurrentUser.UserName &&
|
||||||
a.IsCustomized &&
|
a.IsCustomized &&
|
||||||
a.Channel == Input.Channel &&
|
a.Channel == Input.Channel &&
|
||||||
a.NotificationType == Input.NotificationType);
|
a.NotificationTypeId == Input.NotificationTypeId);
|
||||||
if (item is null)
|
if (item is null)
|
||||||
{
|
{
|
||||||
// insert
|
// insert
|
||||||
item = new NotificationRule
|
item = new NotificationRule
|
||||||
{
|
{
|
||||||
NotificationType = Input.NotificationType,
|
NotificationTypeId = Input.NotificationTypeId,
|
||||||
RecipientType = NotificationRecipientTypes.User,
|
RecipientType = NotificationRecipientTypes.User,
|
||||||
RecipientId = CurrentUser.UserName,
|
RecipientId = CurrentUser.UserName,
|
||||||
Channel = Input.Channel,
|
Channel = Input.Channel,
|
||||||
|
|
@ -144,51 +149,16 @@ public class NotificationRuleAppService : CrudAppService<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DeleteMyNotificationRules(string NotificationType)
|
public async Task DeleteMyNotificationRules(Guid NotificationTypeId)
|
||||||
{
|
{
|
||||||
var query = await CreateFilteredQueryAsync(new PagedAndSortedResultRequestDto());
|
var query = await CreateFilteredQueryAsync(new PagedAndSortedResultRequestDto());
|
||||||
var items = await query.Where(a =>
|
var items = await query.Where(a =>
|
||||||
a.RecipientType == NotificationRecipientTypes.User &&
|
a.RecipientType == NotificationRecipientTypes.User &&
|
||||||
a.RecipientId == CurrentUser.UserName &&
|
a.RecipientId == CurrentUser.UserName &&
|
||||||
a.IsCustomized &&
|
a.IsCustomized &&
|
||||||
a.NotificationType == NotificationType)
|
a.NotificationTypeId == NotificationTypeId)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
await Repository.DeleteManyAsync(items);
|
await Repository.DeleteManyAsync(items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
var defaultRules = await query.Where(a => !a.IsCustomized && a.IsActive)
|
|
||||||
.GroupBy(a => new { a.NotificationType, a.Channel })
|
|
||||||
.Select(a => new NotificationRuleDto
|
|
||||||
{
|
|
||||||
Id = a.FirstOrDefault(a => a.UserId != null)?.Id ?? a.First().Id,
|
|
||||||
NotificationType = a.Key.NotificationType,
|
|
||||||
Channel = a.Key.Channel,
|
|
||||||
IsActive = a.First().IsActive,
|
|
||||||
IsFixed = a.First().IsFixed,
|
|
||||||
IsCustomized = a.First().IsCustomized,
|
|
||||||
})
|
|
||||||
.ToListAsync();
|
|
||||||
var customizedRules = await query.Where(a => a.IsCustomized)
|
|
||||||
.Select(a => new NotificationRuleDto
|
|
||||||
{
|
|
||||||
Id = a.Id,
|
|
||||||
NotificationType = a.NotificationType,
|
|
||||||
Channel = a.Channel,
|
|
||||||
IsActive = a.IsActive,
|
|
||||||
IsFixed = a.IsFixed,
|
|
||||||
IsCustomized = a.IsCustomized
|
|
||||||
})
|
|
||||||
.ToListAsync();
|
|
||||||
|
|
||||||
//defaultRules.IsFixed
|
|
||||||
//customizedRules - defaultRules.IsFixed
|
|
||||||
//!defaultRules.IsFixed - customizedRules
|
|
||||||
var list = new List<NotificationRuleDto>();
|
|
||||||
list.AddRange(defaultRules.Where(a => a.IsFixed).ToList());
|
|
||||||
list.AddRange(customizedRules.Where(a => !list.Any(b => b.NotificationType == a.NotificationType && b.Channel == a.Channel)).ToList());
|
|
||||||
list.AddRange(defaultRules.Where(a => !a.IsFixed && !list.Any(b => b.NotificationType == a.NotificationType && b.Channel == a.Channel)).ToList());
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,6 @@ public static class NotificationChannels
|
||||||
public const string UiActivity = "UiActivity";
|
public const string UiActivity = "UiActivity";
|
||||||
public const string UiToast = "UiToast";
|
public const string UiToast = "UiToast";
|
||||||
public const string WhatsApp = "WhatsApp";
|
public const string WhatsApp = "WhatsApp";
|
||||||
public const string Telegram = "Telegram";
|
// public const string Telegram = "Telegram";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
using Volo.Abp.Reflection;
|
|
||||||
|
|
||||||
namespace Sozsoft.Notifications.Enums;
|
|
||||||
|
|
||||||
public static class NotificationTypes
|
|
||||||
{
|
|
||||||
// public const string SiparisPasla = "SiparisPasla";
|
|
||||||
// public const string YeniSiparis = "YeniSiparis";
|
|
||||||
// public const string YeniKullanici = "YeniKullanici";
|
|
||||||
|
|
||||||
public static string[] GetAll()
|
|
||||||
{
|
|
||||||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(NotificationTypes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Volo.Abp.Domain.Entities.Auditing;
|
using Volo.Abp.Domain.Entities.Auditing;
|
||||||
|
|
||||||
namespace Sozsoft.Notifications.Entities;
|
namespace Sozsoft.Notifications.Entities;
|
||||||
|
|
@ -7,7 +8,8 @@ public class Notification : FullAuditedEntity<Guid>
|
||||||
{
|
{
|
||||||
public Guid NotificationRuleId { get; set; }
|
public Guid NotificationRuleId { get; set; }
|
||||||
public required string NotificationChannel { get; set; }
|
public required string NotificationChannel { get; set; }
|
||||||
public required string NotificationType { get; set; }
|
public required Guid NotificationTypeId { get; set; }
|
||||||
|
public virtual NotificationType NotificationType { get; set; }
|
||||||
|
|
||||||
// Bildirim tipine göre bildirimi alacak olan hedef bilgisini içerir
|
// Bildirim tipine göre bildirimi alacak olan hedef bilgisini içerir
|
||||||
public required string Identifier { get; set; } //UserId, Email, PhoneNumber..
|
public required string Identifier { get; set; } //UserId, Email, PhoneNumber..
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ namespace Sozsoft.Notifications.Entities;
|
||||||
|
|
||||||
public class NotificationRule : FullAuditedEntity<Guid>
|
public class NotificationRule : FullAuditedEntity<Guid>
|
||||||
{
|
{
|
||||||
public required string NotificationType { get; set; }
|
public required Guid NotificationTypeId { get; set; }
|
||||||
|
public NotificationType NotificationType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Alıcı Tipi: User, Role, Organization, All, Custom
|
/// Alıcı Tipi: User, Role, Organization, All, Custom
|
||||||
/// User ise RecipientId UserId olacak
|
/// User ise RecipientId UserId olacak
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Volo.Abp.Domain.Entities.Auditing;
|
||||||
|
|
||||||
|
namespace Sozsoft.Notifications.Entities;
|
||||||
|
|
||||||
|
public class NotificationType : FullAuditedEntity<Guid>
|
||||||
|
{
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
public virtual ICollection<NotificationRule> NotificationRules { get; set; } = [];
|
||||||
|
public ICollection<Notification> Notifications { get; set; } = [];
|
||||||
|
}
|
||||||
|
|
@ -40,7 +40,7 @@ public class NotificationIdentifierProvider : INotificationIdentifierProvider
|
||||||
NotificationChannels.UiActivity => user.Id.ToString(),
|
NotificationChannels.UiActivity => user.Id.ToString(),
|
||||||
NotificationChannels.UiToast => user.Id.ToString(),
|
NotificationChannels.UiToast => user.Id.ToString(),
|
||||||
NotificationChannels.WhatsApp => user.PhoneNumber,
|
NotificationChannels.WhatsApp => user.PhoneNumber,
|
||||||
NotificationChannels.Telegram => user.PhoneNumber,
|
// NotificationChannels.Telegram => user.PhoneNumber,
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,13 @@ namespace Sozsoft.Notifications.Domain;
|
||||||
|
|
||||||
public interface INotificationManager : ITransientDependency
|
public interface INotificationManager : ITransientDependency
|
||||||
{
|
{
|
||||||
Task SendNotificationAsync(string NotificationType, string NotificationMessage);
|
Task SendNotificationAsync(Guid NotificationTypeId, string NotificationMessage);
|
||||||
Task SendNotificationAsync(string NotificationType, string NotificationChannel, string NotificationMessage, string Identifier, Guid? UserId = null);
|
Task SendNotificationAsync(string NotificationType, string NotificationChannel, string NotificationMessage, string Identifier, Guid? UserId = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NotificationManager : INotificationManager
|
public class NotificationManager : INotificationManager
|
||||||
{
|
{
|
||||||
|
private readonly IReadOnlyRepository<NotificationType> repositoryType;
|
||||||
private readonly IReadOnlyRepository<NotificationRule> repository;
|
private readonly IReadOnlyRepository<NotificationRule> repository;
|
||||||
private readonly IReadOnlyRepository<IdentityUser> repositoryUser;
|
private readonly IReadOnlyRepository<IdentityUser> repositoryUser;
|
||||||
private readonly IReadOnlyRepository<IdentityRole> repositoryRole;
|
private readonly IReadOnlyRepository<IdentityRole> repositoryRole;
|
||||||
|
|
@ -28,6 +29,7 @@ public class NotificationManager : INotificationManager
|
||||||
private readonly ICurrentUser currentUser;
|
private readonly ICurrentUser currentUser;
|
||||||
|
|
||||||
public NotificationManager(
|
public NotificationManager(
|
||||||
|
IReadOnlyRepository<NotificationType> repositoryType,
|
||||||
IReadOnlyRepository<NotificationRule> repository,
|
IReadOnlyRepository<NotificationRule> repository,
|
||||||
IReadOnlyRepository<IdentityUser> repositoryUser,
|
IReadOnlyRepository<IdentityUser> repositoryUser,
|
||||||
IReadOnlyRepository<IdentityRole> repositoryRole,
|
IReadOnlyRepository<IdentityRole> repositoryRole,
|
||||||
|
|
@ -37,6 +39,7 @@ public class NotificationManager : INotificationManager
|
||||||
ICurrentUser currentUser
|
ICurrentUser currentUser
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
this.repositoryType = repositoryType;
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
this.repositoryUser = repositoryUser;
|
this.repositoryUser = repositoryUser;
|
||||||
this.repositoryRole = repositoryRole;
|
this.repositoryRole = repositoryRole;
|
||||||
|
|
@ -46,9 +49,9 @@ public class NotificationManager : INotificationManager
|
||||||
this.currentUser = currentUser;
|
this.currentUser = currentUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SendNotificationAsync(string NotificationType, string NotificationMessage)
|
public async Task SendNotificationAsync(Guid NotificationTypeId, string NotificationMessage)
|
||||||
{
|
{
|
||||||
var list = await repository.GetListAsync(a => a.NotificationType == NotificationType);
|
var list = await repository.GetListAsync(a => a.NotificationTypeId == NotificationTypeId);
|
||||||
var notificationRules = list
|
var notificationRules = list
|
||||||
.GroupBy(a => new { a.NotificationType, a.Channel })
|
.GroupBy(a => new { a.NotificationType, a.Channel })
|
||||||
.Select(a =>
|
.Select(a =>
|
||||||
|
|
@ -110,11 +113,12 @@ public class NotificationManager : INotificationManager
|
||||||
var notifications = new List<Notification>();
|
var notifications = new List<Notification>();
|
||||||
|
|
||||||
//Eğer "Custom" seçildiyse girilen RecipientId dinamik olabilir. Telefon Numarası, Email vs.
|
//Eğer "Custom" seçildiyse girilen RecipientId dinamik olabilir. Telefon Numarası, Email vs.
|
||||||
if (notificationRule.RecipientType == NotificationRecipientTypes.Custom) {
|
if (notificationRule.RecipientType == NotificationRecipientTypes.Custom)
|
||||||
|
{
|
||||||
var notification = new Notification
|
var notification = new Notification
|
||||||
{
|
{
|
||||||
|
NotificationTypeId = notificationRule.NotificationTypeId,
|
||||||
NotificationRuleId = notificationRule.Id,
|
NotificationRuleId = notificationRule.Id,
|
||||||
NotificationType = NotificationType,
|
|
||||||
NotificationChannel = notificationRule.Channel,
|
NotificationChannel = notificationRule.Channel,
|
||||||
Identifier = notificationRule.RecipientId!,
|
Identifier = notificationRule.RecipientId!,
|
||||||
UserId = currentUser.Id,
|
UserId = currentUser.Id,
|
||||||
|
|
@ -124,7 +128,8 @@ public class NotificationManager : INotificationManager
|
||||||
};
|
};
|
||||||
notifications.Add(notification);
|
notifications.Add(notification);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
if (userIds.IsNullOrEmpty())
|
if (userIds.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -142,8 +147,8 @@ public class NotificationManager : INotificationManager
|
||||||
|
|
||||||
var notification = new Notification
|
var notification = new Notification
|
||||||
{
|
{
|
||||||
|
NotificationTypeId = notificationRule.NotificationTypeId,
|
||||||
NotificationRuleId = notificationRule.Id,
|
NotificationRuleId = notificationRule.Id,
|
||||||
NotificationType = NotificationType,
|
|
||||||
NotificationChannel = notificationRule.Channel,
|
NotificationChannel = notificationRule.Channel,
|
||||||
Identifier = identifier,
|
Identifier = identifier,
|
||||||
UserId = userId,
|
UserId = userId,
|
||||||
|
|
@ -154,7 +159,7 @@ public class NotificationManager : INotificationManager
|
||||||
notifications.Add(notification);
|
notifications.Add(notification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await repositoryNotification.InsertManyAsync(notifications);
|
await repositoryNotification.InsertManyAsync(notifications);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +168,7 @@ public class NotificationManager : INotificationManager
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Belirtilen Ident
|
/// Belirtilen Ident
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="NotificationType"></param>
|
/// <param name="NotificationTypeId"></param>
|
||||||
/// <param name="NotificationMessage"></param>
|
/// <param name="NotificationMessage"></param>
|
||||||
/// <param name="Identifier"></param>
|
/// <param name="Identifier"></param>
|
||||||
/// <param name="UserId"></param>
|
/// <param name="UserId"></param>
|
||||||
|
|
@ -187,9 +192,12 @@ public class NotificationManager : INotificationManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var notificationType = await repositoryType.FirstOrDefaultAsync(a => a.Name == NotificationType)
|
||||||
|
?? throw new Exception($"NotificationType '{NotificationType}' not found.");
|
||||||
|
|
||||||
await repositoryNotification.InsertAsync(new Notification
|
await repositoryNotification.InsertAsync(new Notification
|
||||||
{
|
{
|
||||||
NotificationType = NotificationType,
|
NotificationTypeId = notificationType.Id,
|
||||||
NotificationChannel = NotificationChannel,
|
NotificationChannel = NotificationChannel,
|
||||||
Identifier = Identifier,
|
Identifier = Identifier,
|
||||||
UserId = UserId,
|
UserId = UserId,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ public class NotificationDbContext : AbpDbContext<NotificationDbContext>, INotif
|
||||||
/* Add DbSet for each Aggregate Root here. Example:
|
/* Add DbSet for each Aggregate Root here. Example:
|
||||||
* public DbSet<Question> Questions { get; set; }
|
* public DbSet<Question> Questions { get; set; }
|
||||||
*/
|
*/
|
||||||
|
public DbSet<NotificationType> NotificationTypes { get; set; }
|
||||||
public DbSet<NotificationRule> NotificationRules { get; set; }
|
public DbSet<NotificationRule> NotificationRules { get; set; }
|
||||||
public DbSet<Notification> Notifications { get; set; }
|
public DbSet<Notification> Notifications { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Sozsoft.Notifications.Domain;
|
|
||||||
using Sozsoft.Notifications.Entities;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Sozsoft.Notifications.Domain;
|
||||||
|
using Sozsoft.Notifications.Entities;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
using Volo.Abp.EntityFrameworkCore.Modeling;
|
using Volo.Abp.EntityFrameworkCore.Modeling;
|
||||||
|
|
||||||
|
|
@ -13,21 +14,29 @@ public static class NotificationDbContextModelCreatingExtensions
|
||||||
{
|
{
|
||||||
Check.NotNull(builder, nameof(builder));
|
Check.NotNull(builder, nameof(builder));
|
||||||
|
|
||||||
|
builder.Entity<NotificationType>(b =>
|
||||||
|
{
|
||||||
|
b.ToTable(TablePrefix.ByName(nameof(NotificationType)), Prefix.DbSchema);
|
||||||
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
|
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
|
||||||
|
});
|
||||||
|
|
||||||
builder.Entity<NotificationRule>(b =>
|
builder.Entity<NotificationRule>(b =>
|
||||||
{
|
{
|
||||||
b.ToTable(TablePrefix.ByName(nameof(NotificationRule)), Prefix.DbSchema);
|
b.ToTable(TablePrefix.ByName(nameof(NotificationRule)), Prefix.DbSchema);
|
||||||
b.ConfigureByConvention();
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
b.Property(x => x.NotificationType).IsRequired().HasMaxLength(128);
|
b.Property(x => x.NotificationTypeId).IsRequired();
|
||||||
|
|
||||||
b.Property(x => x.RecipientType).IsRequired().HasMaxLength(64);
|
b.Property(x => x.RecipientType).IsRequired().HasMaxLength(64);
|
||||||
b.Property(x => x.RecipientId).HasMaxLength(256);
|
b.Property(x => x.RecipientId).HasMaxLength(256);
|
||||||
b.Property(x => x.Channel).IsRequired().HasMaxLength(64);
|
b.Property(x => x.Channel).IsRequired().HasMaxLength(64);
|
||||||
|
|
||||||
// 1:N ilişki NotificationRule -> Notifications
|
b.HasOne(x => x.NotificationType)
|
||||||
b.HasMany(x => x.Notifications)
|
.WithMany(x => x.NotificationRules)
|
||||||
.WithOne(x => x.NotificationRule)
|
.HasForeignKey(x => x.NotificationTypeId)
|
||||||
.HasForeignKey(x => x.NotificationRuleId)
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Entity<Notification>(b =>
|
builder.Entity<Notification>(b =>
|
||||||
|
|
@ -35,10 +44,17 @@ public static class NotificationDbContextModelCreatingExtensions
|
||||||
b.ToTable(TablePrefix.ByName(nameof(Notification)), Prefix.DbSchema);
|
b.ToTable(TablePrefix.ByName(nameof(Notification)), Prefix.DbSchema);
|
||||||
b.ConfigureByConvention();
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
|
b.Property(x => x.NotificationTypeId).IsRequired();
|
||||||
|
b.Property(x => x.NotificationRuleId).IsRequired();
|
||||||
|
|
||||||
b.Property(x => x.NotificationChannel).IsRequired().HasMaxLength(64);
|
b.Property(x => x.NotificationChannel).IsRequired().HasMaxLength(64);
|
||||||
b.Property(x => x.NotificationType).IsRequired().HasMaxLength(128);
|
|
||||||
b.Property(x => x.Identifier).IsRequired().HasMaxLength(256);
|
b.Property(x => x.Identifier).IsRequired().HasMaxLength(256);
|
||||||
b.Property(x => x.Message).IsRequired().HasMaxLength(2048);
|
b.Property(x => x.Message).IsRequired().HasMaxLength(2048);
|
||||||
|
|
||||||
|
b.HasOne(x => x.NotificationType)
|
||||||
|
.WithMany(x => x.Notifications)
|
||||||
|
.HasForeignKey(x => x.NotificationTypeId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,6 @@ public class LookupDto
|
||||||
/// Not: FieldName alaninin veritabani turu int+ turunde ise {key:1:, name:"nn"} seklide olmali
|
/// Not: FieldName alaninin veritabani turu int+ turunde ise {key:1:, name:"nn"} seklide olmali
|
||||||
/// FieldName alaninin veritabani turu string+ turunde ise {key:"1", name:"nn"} seklide olmali
|
/// FieldName alaninin veritabani turu string+ turunde ise {key:"1", name:"nn"} seklide olmali
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string LookupQuery { get; set; }
|
public string LookupQuery { get; set; } //"GET;notification-rule/notification-types;{};a;a;null",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1023,6 +1023,7 @@
|
||||||
"order": 66
|
"order": 66
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"NotificationTypes": [],
|
||||||
"NotificationRules": [
|
"NotificationRules": [
|
||||||
{
|
{
|
||||||
"notificationType": "YeniSiparis",
|
"notificationType": "YeniSiparis",
|
||||||
|
|
@ -1074,7 +1075,7 @@
|
||||||
"isActive": true,
|
"isActive": true,
|
||||||
"dataSourceCode": "Default",
|
"dataSourceCode": "Default",
|
||||||
"beforeSp": "Adm_T_DatabaseBackupAll",
|
"beforeSp": "Adm_T_DatabaseBackupAll",
|
||||||
"afterSp": "Adm_T_DatabaseBackupDeleteAll"
|
"afterSp": "Adm_T_DatabaseBackupFilesDeleteAll"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ContactTitles": [
|
"ContactTitles": [
|
||||||
|
|
|
||||||
|
|
@ -1758,6 +1758,12 @@
|
||||||
"en": "Notifications",
|
"en": "Notifications",
|
||||||
"tr": "Bildirimler"
|
"tr": "Bildirimler"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "App.Notifications.NotificationTypes",
|
||||||
|
"en": "Notification Types",
|
||||||
|
"tr": "Bildirim Türleri"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "App.Notifications.NotificationRules",
|
"key": "App.Notifications.NotificationRules",
|
||||||
|
|
@ -15142,7 +15148,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "App.Listform.ListformField.NotificationType",
|
"key": "App.Listform.ListformField.NotificationTypeId",
|
||||||
"en": "Notification Type",
|
"en": "Notification Type",
|
||||||
"tr": "Bildirim Türü"
|
"tr": "Bildirim Türü"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4186,6 +4186,96 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Notification Type
|
||||||
|
listFormName = AppCodes.Notifications.NotificationTypes;
|
||||||
|
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||||
|
{
|
||||||
|
var listForm = await _listFormRepository.InsertAsync(
|
||||||
|
new ListForm
|
||||||
|
{
|
||||||
|
ListFormType = ListFormTypeEnum.List,
|
||||||
|
PageSize = 10,
|
||||||
|
ExportJson = DefaultExportJson,
|
||||||
|
IsSubForm = false,
|
||||||
|
ShowNote = true,
|
||||||
|
LayoutJson = DefaultLayoutJson(),
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
ListFormCode = listFormName,
|
||||||
|
Name = listFormName,
|
||||||
|
Title = listFormName,
|
||||||
|
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||||
|
IsTenant = false,
|
||||||
|
IsBranch = false,
|
||||||
|
IsOrganizationUnit = false,
|
||||||
|
Description = listFormName,
|
||||||
|
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||||
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NotificationType)),
|
||||||
|
KeyFieldName = "Id",
|
||||||
|
KeyFieldDbSourceType = DbType.Guid,
|
||||||
|
DefaultFilter = DefaultFilterJson,
|
||||||
|
SortMode = GridOptions.SortModeSingle,
|
||||||
|
FilterRowJson = DefaultFilterRowJson,
|
||||||
|
HeaderFilterJson = DefaultHeaderFilterJson,
|
||||||
|
SearchPanelJson = DefaultSearchPanelJson,
|
||||||
|
GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }),
|
||||||
|
SelectionJson = DefaultSelectionSingleJson,
|
||||||
|
ColumnOptionJson = DefaultColumnOptionJson(),
|
||||||
|
PermissionJson = DefaultPermissionJson(listFormName),
|
||||||
|
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.NotificationType)),
|
||||||
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||||
|
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||||
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 400, 200, true, true, true, true, false),
|
||||||
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>
|
||||||
|
{
|
||||||
|
new() {
|
||||||
|
Order = 1, ColCount = 1, ColSpan = 1, ItemType = "group", Items =
|
||||||
|
[
|
||||||
|
new EditingFormItemDto { Order = 1, ColSpan = 1, DataField = "Name", IsRequired = true, EditorType2 = EditorTypes.dxTextBox }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
#region Notification Type Fields
|
||||||
|
await _listFormFieldRepository.InsertManyAsync([
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Guid,
|
||||||
|
FieldName = "Id",
|
||||||
|
CaptionName = "App.Listform.ListformField.Id",
|
||||||
|
Width = 0,
|
||||||
|
ListOrderNo = 1,
|
||||||
|
Visible = false,
|
||||||
|
IsActive = true,
|
||||||
|
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
},
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.String,
|
||||||
|
FieldName = "Name",
|
||||||
|
CaptionName = "App.Listform.ListformField.Name",
|
||||||
|
Width = 0,
|
||||||
|
ListOrderNo = 2,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
|
||||||
|
AllowSearch = true,
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Notification Rule
|
#region Notification Rule
|
||||||
listFormName = AppCodes.Notifications.NotificationRules;
|
listFormName = AppCodes.Notifications.NotificationRules;
|
||||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||||
|
|
@ -4224,10 +4314,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
DeleteCommand = $"UPDATE \"{FullNameTable(TableNameEnum.NotificationRule)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
DeleteCommand = $"UPDATE \"{FullNameTable(TableNameEnum.NotificationRule)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||||
PagerOptionJson = DefaultPagerOptionJson,
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 500, true, true, true, true, false),
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 550, true, true, true, true, false),
|
||||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||||
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
|
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "NotificationType", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 1, DataField = "NotificationTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 2, DataField = "RecipientType", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "RecipientType", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Channel", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 3, DataField = "Channel", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "RecipientId", ColSpan = 1, EditorType2=EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "RecipientId", ColSpan = 1, EditorType2=EditorTypes.dxTextBox },
|
||||||
|
|
@ -4276,21 +4366,22 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
new() {
|
new() {
|
||||||
ListFormCode = listForm.ListFormCode,
|
ListFormCode = listForm.ListFormCode,
|
||||||
CultureName = LanguageCodes.En,
|
CultureName = LanguageCodes.En,
|
||||||
SourceDbType = DbType.String,
|
SourceDbType = DbType.Guid,
|
||||||
FieldName = "NotificationType",
|
FieldName = "NotificationTypeId",
|
||||||
CaptionName = "App.Listform.ListformField.NotificationType",
|
CaptionName = "App.Listform.ListformField.NotificationTypeId",
|
||||||
Width = 0,
|
Width = 0,
|
||||||
ListOrderNo = 2,
|
ListOrderNo = 2,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
|
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.NotificationType), "Id", "Name"),
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.WebService,
|
// LookupJson = JsonSerializer.Serialize(new LookupDto {
|
||||||
DisplayExpr = "Name",
|
// DataSourceType = UiLookupDataSourceTypeEnum.WebService,
|
||||||
ValueExpr = "Key",
|
// DisplayExpr = "Name",
|
||||||
LookupQuery = "GET;notification-rule/notification-types;{};a;a;null",
|
// ValueExpr = "Key",
|
||||||
}),
|
// LookupQuery = "GET;notification-rule/notification-types;{};a;a;null",
|
||||||
|
// }),
|
||||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
|
@ -4465,7 +4556,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
DeleteCommand = $"UPDATE \"{FullNameTable(TableNameEnum.Notification)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
DeleteCommand = $"UPDATE \"{FullNameTable(TableNameEnum.Notification)}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||||
PagerOptionJson = DefaultPagerOptionJson,
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 500, true, true, true, true, false),
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 500, false, false, false, false, false, false),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -4482,7 +4573,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
ListOrderNo = 1,
|
ListOrderNo = 1,
|
||||||
Visible = false,
|
Visible = false,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
|
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
PivotSettingsJson = DefaultPivotSettingsJson
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
|
@ -4513,7 +4603,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
new () { Key="UiActivity",Name="UiActivity" },
|
new () { Key="UiActivity",Name="UiActivity" },
|
||||||
new () { Key="UiToast",Name="UiToast" },
|
new () { Key="UiToast",Name="UiToast" },
|
||||||
new () { Key="WhatsApp",Name="WhatsApp" },
|
new () { Key="WhatsApp",Name="WhatsApp" },
|
||||||
new () { Key="Telegram",Name="Telegram" },
|
// new () { Key="Telegram",Name="Telegram" },
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
|
@ -4523,21 +4613,22 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
new() {
|
new() {
|
||||||
ListFormCode = listForm.ListFormCode,
|
ListFormCode = listForm.ListFormCode,
|
||||||
CultureName = LanguageCodes.En,
|
CultureName = LanguageCodes.En,
|
||||||
SourceDbType = DbType.String,
|
SourceDbType = DbType.Guid,
|
||||||
FieldName = "NotificationType",
|
FieldName = "NotificationTypeId",
|
||||||
CaptionName = "App.Listform.ListformField.NotificationType",
|
CaptionName = "App.Listform.ListformField.NotificationTypeId",
|
||||||
Width = 0,
|
Width = 0,
|
||||||
ListOrderNo = 4,
|
ListOrderNo = 4,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
|
|
||||||
AllowSearch = true,
|
AllowSearch = true,
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.NotificationType), "Id", "Name"),
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.WebService,
|
|
||||||
DisplayExpr = "Name",
|
// LookupJson = JsonSerializer.Serialize(new LookupDto {
|
||||||
ValueExpr = "Key",
|
// DataSourceType = UiLookupDataSourceTypeEnum.WebService,
|
||||||
LookupQuery = "GET;notification-rule/notification-types;{};a;a;null",
|
// DisplayExpr = "Name",
|
||||||
}),
|
// ValueExpr = "Key",
|
||||||
|
// LookupQuery = "GET;notification-rule/notification-types;{};a;a;null",
|
||||||
|
// }),
|
||||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
|
|
||||||
|
|
@ -702,11 +702,21 @@
|
||||||
"RequiredPermissionName": null,
|
"RequiredPermissionName": null,
|
||||||
"IsDisabled": false
|
"IsDisabled": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ParentCode": "App.Notifications",
|
||||||
|
"Code": "App.Notifications.NotificationTypes",
|
||||||
|
"DisplayName": "App.Notifications.NotificationTypes",
|
||||||
|
"Order": 1,
|
||||||
|
"Url": "/admin/list/App.Notifications.NotificationTypes",
|
||||||
|
"Icon": "FcComboChart",
|
||||||
|
"RequiredPermissionName": "App.Notifications.NotificationTypes",
|
||||||
|
"IsDisabled": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ParentCode": "App.Notifications",
|
"ParentCode": "App.Notifications",
|
||||||
"Code": "App.Notifications.NotificationRules",
|
"Code": "App.Notifications.NotificationRules",
|
||||||
"DisplayName": "App.Notifications.NotificationRules",
|
"DisplayName": "App.Notifications.NotificationRules",
|
||||||
"Order": 1,
|
"Order": 2,
|
||||||
"Url": "/admin/list/App.Notifications.NotificationRules",
|
"Url": "/admin/list/App.Notifications.NotificationRules",
|
||||||
"Icon": "FcLibrary",
|
"Icon": "FcLibrary",
|
||||||
"RequiredPermissionName": "App.Notifications.NotificationRules",
|
"RequiredPermissionName": "App.Notifications.NotificationRules",
|
||||||
|
|
@ -716,7 +726,7 @@
|
||||||
"ParentCode": "App.Notifications",
|
"ParentCode": "App.Notifications",
|
||||||
"Code": "App.Notifications.Notification",
|
"Code": "App.Notifications.Notification",
|
||||||
"DisplayName": "App.Notifications.Notification",
|
"DisplayName": "App.Notifications.Notification",
|
||||||
"Order": 2,
|
"Order": 3,
|
||||||
"Url": "/admin/list/App.Notifications.Notification",
|
"Url": "/admin/list/App.Notifications.Notification",
|
||||||
"Icon": "FcBrokenLink",
|
"Icon": "FcBrokenLink",
|
||||||
"RequiredPermissionName": "App.Notifications.Notification",
|
"RequiredPermissionName": "App.Notifications.Notification",
|
||||||
|
|
|
||||||
|
|
@ -1198,6 +1198,62 @@
|
||||||
"MultiTenancySide": 2,
|
"MultiTenancySide": 2,
|
||||||
"MenuGroup": "Erp|Kurs"
|
"MenuGroup": "Erp|Kurs"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"GroupName": "App.Saas",
|
||||||
|
"Name": "App.Notifications.NotificationTypes",
|
||||||
|
"ParentName": null,
|
||||||
|
"DisplayName": "App.Notifications.NotificationTypes",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 2,
|
||||||
|
"MenuGroup": "Erp|Kurs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Saas",
|
||||||
|
"Name": "App.Notifications.NotificationTypes.Create",
|
||||||
|
"ParentName": "App.Notifications.NotificationTypes",
|
||||||
|
"DisplayName": "Create",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 2,
|
||||||
|
"MenuGroup": "Erp|Kurs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Saas",
|
||||||
|
"Name": "App.Notifications.NotificationTypes.Delete",
|
||||||
|
"ParentName": "App.Notifications.NotificationTypes",
|
||||||
|
"DisplayName": "Delete",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 2,
|
||||||
|
"MenuGroup": "Erp|Kurs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Saas",
|
||||||
|
"Name": "App.Notifications.NotificationTypes.Export",
|
||||||
|
"ParentName": "App.Notifications.NotificationTypes",
|
||||||
|
"DisplayName": "Export",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 2,
|
||||||
|
"MenuGroup": "Erp|Kurs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Saas",
|
||||||
|
"Name": "App.Notifications.NotificationTypes.Import",
|
||||||
|
"ParentName": "App.Notifications.NotificationTypes",
|
||||||
|
"DisplayName": "Import",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 2,
|
||||||
|
"MenuGroup": "Erp|Kurs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GroupName": "App.Saas",
|
||||||
|
"Name": "App.Notifications.NotificationTypes.Update",
|
||||||
|
"ParentName": "App.Notifications.NotificationTypes",
|
||||||
|
"DisplayName": "Update",
|
||||||
|
"IsEnabled": true,
|
||||||
|
"MultiTenancySide": 2,
|
||||||
|
"MenuGroup": "Erp|Kurs"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"GroupName": "App.Saas",
|
"GroupName": "App.Saas",
|
||||||
"Name": "App.Notifications.NotificationRules",
|
"Name": "App.Notifications.NotificationRules",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
CREATE OR ALTER PROCEDURE [dbo].[Adm_T_DatabaseBackupDeleteAll]
|
CREATE OR ALTER PROCEDURE [dbo].[Adm_T_DatabaseBackupFilesDeleteAll]
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NOCOUNT ON;
|
SET NOCOUNT ON;
|
||||||
|
|
@ -8,6 +8,7 @@ public enum TableNameEnum
|
||||||
SettingDefinition,
|
SettingDefinition,
|
||||||
Notification,
|
Notification,
|
||||||
NotificationRule,
|
NotificationRule,
|
||||||
|
NotificationType,
|
||||||
BackgroundWorker,
|
BackgroundWorker,
|
||||||
BackgroundWorker_MailQueue,
|
BackgroundWorker_MailQueue,
|
||||||
BackgroundWorker_MailQueueEvents,
|
BackgroundWorker_MailQueueEvents,
|
||||||
|
|
|
||||||
|
|
@ -418,6 +418,7 @@ public static class PlatformConsts
|
||||||
{
|
{
|
||||||
public const string Default = Prefix.App + ".Notifications";
|
public const string Default = Prefix.App + ".Notifications";
|
||||||
|
|
||||||
|
public const string NotificationTypes = Default + ".NotificationTypes";
|
||||||
public const string NotificationRules = Default + ".NotificationRules";
|
public const string NotificationRules = Default + ".NotificationRules";
|
||||||
public const string Notification = Default + ".Notification";
|
public const string Notification = Default + ".Notification";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ public static class TableNameResolver
|
||||||
{ nameof(TableNameEnum.ListFormImportExecute), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
{ nameof(TableNameEnum.ListFormImportExecute), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
{ nameof(TableNameEnum.Notification), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
{ nameof(TableNameEnum.Notification), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
{ nameof(TableNameEnum.NotificationRule), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
{ nameof(TableNameEnum.NotificationRule), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
|
{ nameof(TableNameEnum.NotificationType), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
{ nameof(TableNameEnum.BackgroundWorker), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
{ nameof(TableNameEnum.BackgroundWorker), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
{ nameof(TableNameEnum.BackgroundWorker_MailQueue), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
{ nameof(TableNameEnum.BackgroundWorker_MailQueue), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
{ nameof(TableNameEnum.BackgroundWorker_MailQueueEvents), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
{ nameof(TableNameEnum.BackgroundWorker_MailQueueEvents), (TablePrefix.PlatformByName, MenuPrefix.Saas) },
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class PlatformBackgroundWorker : PlatformDomainService, IPlatformBackgrou
|
||||||
{
|
{
|
||||||
using var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin(requiresNew: true, isTransactional: false);
|
using var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin(requiresNew: true, isTransactional: false);
|
||||||
|
|
||||||
var Worker = await Repository.GetAsync(a => a.Id == WorkerId);
|
var Worker = await Repository.FirstOrDefaultAsync(a => a.Id == WorkerId);
|
||||||
|
|
||||||
var LogPrefix = $"{Clock.Now:s}_{Worker.Name}: {{0}}";
|
var LogPrefix = $"{Clock.Now:s}_{Worker.Name}: {{0}}";
|
||||||
var DistributedLockName = Worker.Name;
|
var DistributedLockName = Worker.Name;
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,7 @@ public static class SeedConsts
|
||||||
{
|
{
|
||||||
public const string Default = Prefix.App + ".Notifications";
|
public const string Default = Prefix.App + ".Notifications";
|
||||||
|
|
||||||
|
public const string NotificationTypes = Default + ".NotificationTypes";
|
||||||
public const string NotificationRules = Default + ".NotificationRules";
|
public const string NotificationRules = Default + ".NotificationRules";
|
||||||
public const string Notification = Default + ".Notification";
|
public const string Notification = Default + ".Notification";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Sozsoft.Platform.Migrations
|
namespace Sozsoft.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20260508144450_Initial")]
|
[Migration("20260511093511_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -397,10 +397,8 @@ namespace Sozsoft.Platform.Migrations
|
||||||
b.Property<Guid>("NotificationRuleId")
|
b.Property<Guid>("NotificationRuleId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<string>("NotificationType")
|
b.Property<Guid>("NotificationTypeId")
|
||||||
.IsRequired()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasMaxLength(128)
|
|
||||||
.HasColumnType("nvarchar(128)");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ReadTime")
|
b.Property<DateTime?>("ReadTime")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
@ -412,6 +410,8 @@ namespace Sozsoft.Platform.Migrations
|
||||||
|
|
||||||
b.HasIndex("NotificationRuleId");
|
b.HasIndex("NotificationRuleId");
|
||||||
|
|
||||||
|
b.HasIndex("NotificationTypeId");
|
||||||
|
|
||||||
b.ToTable("Sas_H_Notification", (string)null);
|
b.ToTable("Sas_H_Notification", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -465,10 +465,8 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasColumnName("LastModifierId");
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
b.Property<string>("NotificationType")
|
b.Property<Guid>("NotificationTypeId")
|
||||||
.IsRequired()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasMaxLength(128)
|
|
||||||
.HasColumnType("nvarchar(128)");
|
|
||||||
|
|
||||||
b.Property<string>("RecipientId")
|
b.Property<string>("RecipientId")
|
||||||
.HasMaxLength(256)
|
.HasMaxLength(256)
|
||||||
|
|
@ -481,9 +479,57 @@ namespace Sozsoft.Platform.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NotificationTypeId");
|
||||||
|
|
||||||
b.ToTable("Sas_H_NotificationRule", (string)null);
|
b.ToTable("Sas_H_NotificationRule", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Sozsoft.Notifications.Entities.NotificationType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("nvarchar(128)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Sas_H_NotificationType", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Sozsoft.Platform.Entities.About", b =>
|
modelBuilder.Entity("Sozsoft.Platform.Entities.About", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -7711,7 +7757,26 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Sozsoft.Notifications.Entities.NotificationType", "NotificationType")
|
||||||
|
.WithMany("Notifications")
|
||||||
|
.HasForeignKey("NotificationTypeId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("NotificationRule");
|
b.Navigation("NotificationRule");
|
||||||
|
|
||||||
|
b.Navigation("NotificationType");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Sozsoft.Notifications.Entities.NotificationRule", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Sozsoft.Notifications.Entities.NotificationType", "NotificationType")
|
||||||
|
.WithMany("NotificationRules")
|
||||||
|
.HasForeignKey("NotificationTypeId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("NotificationType");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogPost", b =>
|
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogPost", b =>
|
||||||
|
|
@ -8236,6 +8301,13 @@ namespace Sozsoft.Platform.Migrations
|
||||||
b.Navigation("Notifications");
|
b.Navigation("Notifications");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Sozsoft.Notifications.Entities.NotificationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("NotificationRules");
|
||||||
|
|
||||||
|
b.Navigation("Notifications");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogCategory", b =>
|
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogCategory", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Posts");
|
b.Navigation("Posts");
|
||||||
|
|
@ -1414,17 +1414,11 @@ namespace Sozsoft.Platform.Migrations
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Sas_H_NotificationRule",
|
name: "Sas_H_NotificationType",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
NotificationType = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||||
RecipientType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
|
||||||
RecipientId = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
||||||
Channel = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
|
||||||
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
IsFixed = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
IsCustomized = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
|
@ -1435,7 +1429,7 @@ namespace Sozsoft.Platform.Migrations
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Sas_H_NotificationRule", x => x.Id);
|
table.PrimaryKey("PK_Sas_H_NotificationType", x => x.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
|
|
@ -2611,19 +2605,17 @@ namespace Sozsoft.Platform.Migrations
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Sas_H_Notification",
|
name: "Sas_H_NotificationRule",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
NotificationRuleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
NotificationTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
NotificationChannel = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
RecipientType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
NotificationType = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
RecipientId = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
Identifier = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
|
Channel = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
||||||
Message = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false),
|
IsFixed = table.Column<bool>(type: "bit", nullable: false),
|
||||||
IsSent = table.Column<bool>(type: "bit", nullable: false),
|
IsCustomized = table.Column<bool>(type: "bit", nullable: false),
|
||||||
IsRead = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
ReadTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
||||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
|
@ -2634,13 +2626,13 @@ namespace Sozsoft.Platform.Migrations
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Sas_H_Notification", x => x.Id);
|
table.PrimaryKey("PK_Sas_H_NotificationRule", x => x.Id);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Sas_H_Notification_Sas_H_NotificationRule_NotificationRuleId",
|
name: "FK_Sas_H_NotificationRule_Sas_H_NotificationType_NotificationTypeId",
|
||||||
column: x => x.NotificationRuleId,
|
column: x => x.NotificationTypeId,
|
||||||
principalTable: "Sas_H_NotificationRule",
|
principalTable: "Sas_H_NotificationType",
|
||||||
principalColumn: "Id",
|
principalColumn: "Id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
|
|
@ -3109,6 +3101,45 @@ namespace Sozsoft.Platform.Migrations
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Sas_H_Notification",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
NotificationRuleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
NotificationChannel = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
|
NotificationTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
Identifier = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
Message = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false),
|
||||||
|
IsSent = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
IsRead = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
ReadTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Sas_H_Notification", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Sas_H_Notification_Sas_H_NotificationRule_NotificationRuleId",
|
||||||
|
column: x => x.NotificationRuleId,
|
||||||
|
principalTable: "Sas_H_NotificationRule",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Sas_H_Notification_Sas_H_NotificationType_NotificationTypeId",
|
||||||
|
column: x => x.NotificationTypeId,
|
||||||
|
principalTable: "Sas_H_NotificationType",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Sas_T_ForumPost",
|
name: "Sas_T_ForumPost",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
|
|
@ -3685,6 +3716,16 @@ namespace Sozsoft.Platform.Migrations
|
||||||
table: "Sas_H_Notification",
|
table: "Sas_H_Notification",
|
||||||
column: "NotificationRuleId");
|
column: "NotificationRuleId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Sas_H_Notification_NotificationTypeId",
|
||||||
|
table: "Sas_H_Notification",
|
||||||
|
column: "NotificationTypeId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Sas_H_NotificationRule_NotificationTypeId",
|
||||||
|
table: "Sas_H_NotificationRule",
|
||||||
|
column: "NotificationTypeId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Sas_H_OrderItem_OrderId",
|
name: "IX_Sas_H_OrderItem_OrderId",
|
||||||
table: "Sas_H_OrderItem",
|
table: "Sas_H_OrderItem",
|
||||||
|
|
@ -4089,6 +4130,9 @@ namespace Sozsoft.Platform.Migrations
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Sas_H_ListForm");
|
name: "Sas_H_ListForm");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Sas_H_NotificationType");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Sas_T_ForumCategory");
|
name: "Sas_T_ForumCategory");
|
||||||
|
|
||||||
|
|
@ -394,10 +394,8 @@ namespace Sozsoft.Platform.Migrations
|
||||||
b.Property<Guid>("NotificationRuleId")
|
b.Property<Guid>("NotificationRuleId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<string>("NotificationType")
|
b.Property<Guid>("NotificationTypeId")
|
||||||
.IsRequired()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasMaxLength(128)
|
|
||||||
.HasColumnType("nvarchar(128)");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("ReadTime")
|
b.Property<DateTime?>("ReadTime")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
@ -409,6 +407,8 @@ namespace Sozsoft.Platform.Migrations
|
||||||
|
|
||||||
b.HasIndex("NotificationRuleId");
|
b.HasIndex("NotificationRuleId");
|
||||||
|
|
||||||
|
b.HasIndex("NotificationTypeId");
|
||||||
|
|
||||||
b.ToTable("Sas_H_Notification", (string)null);
|
b.ToTable("Sas_H_Notification", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -462,10 +462,8 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasColumnName("LastModifierId");
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
b.Property<string>("NotificationType")
|
b.Property<Guid>("NotificationTypeId")
|
||||||
.IsRequired()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasMaxLength(128)
|
|
||||||
.HasColumnType("nvarchar(128)");
|
|
||||||
|
|
||||||
b.Property<string>("RecipientId")
|
b.Property<string>("RecipientId")
|
||||||
.HasMaxLength(256)
|
.HasMaxLength(256)
|
||||||
|
|
@ -478,9 +476,57 @@ namespace Sozsoft.Platform.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NotificationTypeId");
|
||||||
|
|
||||||
b.ToTable("Sas_H_NotificationRule", (string)null);
|
b.ToTable("Sas_H_NotificationRule", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Sozsoft.Notifications.Entities.NotificationType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("CreationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatorId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("CreatorId");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleterId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("DeleterId");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletionTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnName("IsDeleted");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
|
.HasColumnType("datetime2")
|
||||||
|
.HasColumnName("LastModificationTime");
|
||||||
|
|
||||||
|
b.Property<Guid?>("LastModifierId")
|
||||||
|
.HasColumnType("uniqueidentifier")
|
||||||
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("nvarchar(128)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Sas_H_NotificationType", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Sozsoft.Platform.Entities.About", b =>
|
modelBuilder.Entity("Sozsoft.Platform.Entities.About", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -7708,7 +7754,26 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Sozsoft.Notifications.Entities.NotificationType", "NotificationType")
|
||||||
|
.WithMany("Notifications")
|
||||||
|
.HasForeignKey("NotificationTypeId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("NotificationRule");
|
b.Navigation("NotificationRule");
|
||||||
|
|
||||||
|
b.Navigation("NotificationType");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Sozsoft.Notifications.Entities.NotificationRule", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Sozsoft.Notifications.Entities.NotificationType", "NotificationType")
|
||||||
|
.WithMany("NotificationRules")
|
||||||
|
.HasForeignKey("NotificationTypeId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("NotificationType");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogPost", b =>
|
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogPost", b =>
|
||||||
|
|
@ -8233,6 +8298,13 @@ namespace Sozsoft.Platform.Migrations
|
||||||
b.Navigation("Notifications");
|
b.Navigation("Notifications");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Sozsoft.Notifications.Entities.NotificationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("NotificationRules");
|
||||||
|
|
||||||
|
b.Navigation("Notifications");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogCategory", b =>
|
modelBuilder.Entity("Sozsoft.Platform.Entities.BlogCategory", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Posts");
|
b.Navigation("Posts");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue