Chapter officers can merge a markdown note onto filtered students, teams, or events and save the recipe. Extra student-note columns are additional fields (any ## … fields heading) so they work as print tokens whether imported or typed by hand. Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
926 B
C#
36 lines
926 B
C#
using Core.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Data.Configurations;
|
|
|
|
public class PrintPresetConfiguration : IEntityTypeConfiguration<PrintPreset>
|
|
{
|
|
public void Configure(EntityTypeBuilder<PrintPreset> builder)
|
|
{
|
|
builder.HasKey(p => p.Id);
|
|
|
|
builder.Property(p => p.Name)
|
|
.IsRequired()
|
|
.HasMaxLength(100);
|
|
|
|
builder.HasIndex(p => p.Name)
|
|
.IsUnique();
|
|
|
|
builder.Property(p => p.EntityType)
|
|
.HasConversion<string>()
|
|
.HasMaxLength(32)
|
|
.IsRequired();
|
|
|
|
builder.Property(p => p.FiltersJson)
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
builder.HasOne(p => p.Note)
|
|
.WithMany()
|
|
.HasForeignKey(p => p.NoteId)
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
}
|
|
}
|