Clinical Sync Batch Engine: first commit

This commit is contained in:
voltsrage
2026-06-23 03:02:30 +08:00
parent 90b8baa2a1
commit c9994b1ba2
60 changed files with 3547 additions and 31 deletions
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
public class ClinicalSyncConflictConfiguration : IEntityTypeConfiguration<ClinicalSyncConflict>
{
public void Configure(EntityTypeBuilder<ClinicalSyncConflict> builder)
{
builder.ToTable("clinical_sync_conflicts");
builder.HasKey(c => c.Id);
builder.Property(c => c.Id).HasColumnName("id").HasDefaultValueSql("gen_random_uuid()");
builder.Property(c => c.BatchId).HasColumnName("batch_id");
builder.Property(c => c.ClientRef).HasColumnName("client_ref");
builder.Property(c => c.ItemType).HasColumnName("item_type").HasMaxLength(16);
builder.Property(c => c.ConflictReason).HasColumnName("conflict_reason").HasMaxLength(500);
builder.Property(c => c.CreatedAt).HasColumnName("created_at").HasDefaultValueSql("NOW()");
builder.HasOne(c => c.Batch)
.WithMany(b => b.Conflicts)
.HasForeignKey(c => c.BatchId)
.OnDelete(DeleteBehavior.Restrict);
}
}