using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Workflow.Domain.Entities;

namespace Workflow.Infrastructure.Persistence.Configurations;

public class WorkflowTokenConfiguration : IEntityTypeConfiguration<WorkflowToken>
{
    public void Configure(EntityTypeBuilder<WorkflowToken> builder)
    {
        builder.ToTable("wf_workflow_tokens");

        builder.HasKey(e => e.Id);
        builder.Property(e => e.Id).ValueGeneratedNever();

        builder.Property(e => e.NodeId).HasMaxLength(500);

        builder.HasIndex(e => e.InstanceId);
    }
}
