feat: add a Tools page printer for note merge and print presets
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>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user