- Nouveau NtfyService: topic isolé par user (heimdall_{userId})
- Configuration globale Ntfy:BaseUrl + Ntfy:Token (plus de token par user)
- Renommage UserNotificationConfig: Gotify* → Ntfy*
- Migration des colonnes DB: gotify_enabled/url/token → ntfy_enabled/url
- Ajout service ntfy dans docker-compose (binwiederhier/ntfy)
- Mise à jour .env.example avec NTFY__BASE_URL et NTFY__TOKEN
- Suppression GotifyService et IGotifyService
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Heimdall.Domain.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Heimdall.Infrastructure.Data.Configurations;
|
|
|
|
public class UserNotificationConfigConfiguration : IEntityTypeConfiguration<UserNotificationConfig>
|
|
{
|
|
public void Configure(EntityTypeBuilder<UserNotificationConfig> builder)
|
|
{
|
|
builder.ToTable("user_notification_configs");
|
|
|
|
builder.HasKey(c => c.Id);
|
|
|
|
builder.Property(c => c.EmailAddress)
|
|
.HasMaxLength(200);
|
|
|
|
builder.Property(c => c.NtfyUrl)
|
|
.HasMaxLength(500);
|
|
|
|
builder.Property(c => c.Language)
|
|
.HasMaxLength(10)
|
|
.HasDefaultValue("fr");
|
|
|
|
builder.Property(c => c.SubscribedEventsJson)
|
|
.HasColumnName("subscribed_events")
|
|
.HasColumnType("jsonb");
|
|
|
|
builder.Property(c => c.CreatedAt)
|
|
.HasDefaultValueSql("NOW()");
|
|
|
|
builder.Property(c => c.UpdatedAt)
|
|
.HasDefaultValueSql("NOW()");
|
|
|
|
// Indexes
|
|
builder.HasIndex(c => c.UserId).IsUnique();
|
|
}
|
|
}
|