18 lines
759 B
C#
18 lines
759 B
C#
namespace LiteCharms.Features.MidrandBooks.Orders.Entities;
|
|
|
|
public class ShippingProviderConfiguration : IEntityTypeConfiguration<ShippingProvider>
|
|
{
|
|
public void Configure(EntityTypeBuilder<ShippingProvider> builder)
|
|
{
|
|
builder.ToTable("ShippingProviders");
|
|
|
|
builder.HasKey(f => f.Id);
|
|
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd().HasDefaultValueSql("now()");
|
|
builder.Property(f => f.UpdatedAt).HasDefaultValueSql("now()");
|
|
builder.Property(f => f.Type).IsRequired();
|
|
builder.Property(f => f.Name).IsRequired().HasMaxLength(100);
|
|
builder.Property(f => f.Price).IsRequired().HasPrecision(18, 2);
|
|
builder.Property(f => f.Enabled).HasDefaultValue(true);
|
|
}
|
|
}
|