59 lines
2 KiB
C#
59 lines
2 KiB
C#
|
|
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,
|
|||
|
|
RecipientId = "admin",
|
|||
|
|
Channel = NotificationChannels.UiActivity,
|
|||
|
|
IsActive = true,
|
|||
|
|
IsFixed = false,
|
|||
|
|
IsCustomized = false
|
|||
|
|
},
|
|||
|
|
new() {
|
|||
|
|
NotificationType = NotificationTypes.SiparisPasla,
|
|||
|
|
RecipientType = NotificationRecipientTypes.Role,
|
|||
|
|
RecipientId = "admin",
|
|||
|
|
Channel = NotificationChannels.Desktop,
|
|||
|
|
IsActive = true,
|
|||
|
|
IsFixed = false,
|
|||
|
|
IsCustomized = false
|
|||
|
|
},
|
|||
|
|
new() {
|
|||
|
|
NotificationType = NotificationTypes.YeniKullanici,
|
|||
|
|
RecipientType = NotificationRecipientTypes.Role,
|
|||
|
|
RecipientId = "admin",
|
|||
|
|
Channel = NotificationChannels.Rocket,
|
|||
|
|
IsActive = true,
|
|||
|
|
IsFixed = false,
|
|||
|
|
IsCustomized = false
|
|||
|
|
},
|
|||
|
|
]);
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
}
|