using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TeleWave.Domain.Images;

namespace TeleWave.Infrastructure.Persistence.Configurations;

public class ImageConfiguration : IEntityTypeConfiguration<Image>
{
    public void Configure(EntityTypeBuilder<Image> builder)
    {
        builder.Property(x => x.FileExtension).IsRequired().HasMaxLength(16);
        builder.Property(x => x.OriginalFileName).HasMaxLength(512);
        builder.HasIndex(x => new { x.Category, x.CreatedAt });
    }
}
