feat(push): add service-owned firebase channels and delivery

Add push contracts, provider delivery and channel diagnostics. Link email channels to services and document migration and validation.

Ref: IT-1074
This commit is contained in:
2026-10-24 12:31:35 +03:00
parent b30dba93e8
commit 1631786ce2
105 changed files with 3838 additions and 147 deletions
@@ -13,12 +13,10 @@ internal class EmailChannelEntityConfiguration : IEntityTypeConfiguration<EmailC
builder.HasKey(x => x.Id);
builder.Property(x => x.Id).HasColumnName("id");
builder.Property(x => x.ServiceName)
.HasColumnName("service_name")
.IsRequired()
.HasMaxLength(100);
builder.HasIndex(x => new { x.ServiceName, x.Priority });
builder.Property(x => x.ServiceId).HasColumnName("service_id").IsRequired();
builder.HasOne(x => x.Service).WithMany().HasForeignKey(x => x.ServiceId)
.OnDelete(DeleteBehavior.Restrict);
builder.HasIndex(x => new { x.ServiceId, x.Priority });
builder.Property(x => x.Priority).HasColumnName("priority");
@@ -0,0 +1,23 @@
using HrynCo.NotificationService.DAL.EF.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace HrynCo.NotificationService.DAL.EF.Configurations;
internal sealed class PushChannelEntityConfiguration : IEntityTypeConfiguration<PushChannelEntity>
{
public void Configure(EntityTypeBuilder<PushChannelEntity> builder)
{
builder.ToTable("push_channels");
builder.HasKey(x => x.Id);
builder.Property(x => x.Id).HasColumnName("id");
builder.Property(x => x.ServiceId).HasColumnName("service_id");
builder.HasIndex(x => x.ServiceId).IsUnique();
builder.HasOne(x => x.Service).WithMany().HasForeignKey(x => x.ServiceId).OnDelete(DeleteBehavior.Restrict);
builder.Property(x => x.FirebaseProjectId).HasColumnName("firebase_project_id").HasMaxLength(30).IsRequired();
builder.Property(x => x.CredentialsJson).HasColumnName("credentials").HasColumnType("jsonb").IsRequired();
builder.Property(x => x.IsActive).HasColumnName("is_active");
builder.Property(x => x.Created).HasColumnName("created");
builder.Property(x => x.Updated).HasColumnName("updated");
}
}
@@ -0,0 +1,17 @@
namespace HrynCo.NotificationService.DAL.EF.Configurations;
using HrynCo.NotificationService.DAL.EF.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
public sealed class PushDeliveryEntityConfiguration : IEntityTypeConfiguration<PushDeliveryEntity>
{
public void Configure(EntityTypeBuilder<PushDeliveryEntity> builder)
{
builder.ToTable("PushDeliveries");
builder.HasKey(x => new { x.ServiceName, x.MessageId });
builder.Property(x => x.ServiceName).HasMaxLength(128);
builder.Property(x => x.Error).HasMaxLength(256);
builder.HasIndex(x => x.CompletedAt);
}
}