feat(store): 扩展临时时段配置

This commit is contained in:
2026-01-20 18:41:34 +08:00
parent 3385674490
commit 32f5bbbd43
15 changed files with 7871 additions and 33 deletions

View File

@@ -18,6 +18,7 @@ using TakeoutSaaS.Domain.Products.Entities;
using TakeoutSaaS.Domain.Queues.Entities;
using TakeoutSaaS.Domain.Reservations.Entities;
using TakeoutSaaS.Domain.Stores.Entities;
using TakeoutSaaS.Domain.Stores.Enums;
using TakeoutSaaS.Domain.Tenants.Entities;
using TakeoutSaaS.Domain.Tenants.Enums;
using TakeoutSaaS.Infrastructure.Common.Persistence;
@@ -959,8 +960,15 @@ public sealed class TakeoutAppDbContext(
builder.ToTable("store_holidays");
builder.HasKey(x => x.Id);
builder.Property(x => x.StoreId).IsRequired();
builder.Property(x => x.Reason).HasMaxLength(256);
builder.HasIndex(x => new { x.TenantId, x.StoreId, x.Date }).IsUnique();
builder.Property(x => x.Date).IsRequired();
builder.Property(x => x.EndDate);
builder.Property(x => x.IsAllDay).HasDefaultValue(true);
builder.Property(x => x.StartTime);
builder.Property(x => x.EndTime);
builder.Property(x => x.OverrideType).HasDefaultValue(OverrideType.Closed);
builder.Property(x => x.IsClosed).HasDefaultValue(true);
builder.Property(x => x.Reason).HasMaxLength(200);
builder.HasIndex(x => new { x.TenantId, x.StoreId, x.Date });
}
private static void ConfigureStoreDeliveryZone(EntityTypeBuilder<StoreDeliveryZone> builder)