feature: Approval and Promotion to VigilCareClinical

This commit is contained in:
voltsrage
2026-06-26 15:05:02 +08:00
parent 470df683dd
commit 706318e5d2
40 changed files with 5639 additions and 3 deletions
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
public class OutboxEventConfiguration : IEntityTypeConfiguration<OutboxEvent>
{
public void Configure(EntityTypeBuilder<OutboxEvent> builder)
{
builder.ToTable("outbox_events", "clinical");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).HasColumnName("id").HasDefaultValueSql("gen_random_uuid()");
builder.Property(e => e.EventType).HasColumnName("event_type").HasMaxLength(100).IsRequired();
builder.Property(e => e.AggregateType).HasColumnName("aggregate_type").HasMaxLength(50).IsRequired();
builder.Property(e => e.AggregateId).HasColumnName("aggregate_id").IsRequired();
builder.Property(e => e.PayloadJson).HasColumnName("payload_json").HasColumnType("jsonb").IsRequired();
builder.Property(e => e.CreatedAt).HasColumnName("created_at").HasDefaultValueSql("NOW()");
builder.Property(e => e.ProcessedAt).HasColumnName("processed_at");
builder.Property(e => e.RetryCount).HasColumnName("retry_count").HasDefaultValue(0);
builder.HasIndex(e => e.ProcessedAt)
.HasFilter("processed_at IS NULL")
.HasDatabaseName("ix_outbox_events_unprocessed");
}
}