erp-platform/api/src/Kurs.Platform.DbMigrator/Seeds/NotificationRuleSeeder.cs

59 lines
2.1 KiB
C#
Raw Normal View History

2025-05-06 06:45:49 +00:00
using System;
using System.Threading.Tasks;
using Kurs.Notifications.Domain;
using Kurs.Notifications.Entities;
using Kurs.Notifications.Enums;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
namespace Kurs.Platform.Data.Seeds;
public class NotificationRuleSeeder : IDataSeedContributor, ITransientDependency
{
private readonly IRepository<NotificationRule, Guid> _notificationRuleRepository;
public NotificationRuleSeeder(
IRepository<NotificationRule, Guid> notificationRuleRepository)
{
_notificationRuleRepository = notificationRuleRepository;
}
public async Task SeedAsync(DataSeedContext context)
{
#region NotificationRule
await _notificationRuleRepository.InsertManyAsync([
new() {
NotificationType = NotificationTypes.YeniSiparis,
RecipientType = NotificationRecipientTypes.Role,
2025-05-06 11:03:45 +00:00
RecipientId = PlatformConsts.AbpIdentity.User.AdminRoleName,
2025-05-06 06:45:49 +00:00
Channel = NotificationChannels.UiActivity,
IsActive = true,
IsFixed = false,
IsCustomized = false
},
new() {
NotificationType = NotificationTypes.SiparisPasla,
RecipientType = NotificationRecipientTypes.Role,
2025-05-06 11:03:45 +00:00
RecipientId = PlatformConsts.AbpIdentity.User.AdminRoleName,
2025-05-06 06:45:49 +00:00
Channel = NotificationChannels.Desktop,
IsActive = true,
IsFixed = false,
IsCustomized = false
},
new() {
NotificationType = NotificationTypes.YeniKullanici,
RecipientType = NotificationRecipientTypes.Role,
2025-05-06 11:03:45 +00:00
RecipientId = PlatformConsts.AbpIdentity.User.AdminRoleName,
2025-05-06 06:45:49 +00:00
Channel = NotificationChannels.Rocket,
IsActive = true,
IsFixed = false,
IsCustomized = false
},
]);
#endregion
}
}