using TakeoutSaaS.Domain.Tenants.Enums;
using TakeoutSaaS.Shared.Abstractions.Entities;

namespace TakeoutSaaS.Domain.Tenants.Entities;

/// <summary>
/// 租户套餐定义，描述不同等级的服务套餐。
/// </summary>
public sealed class TenantPackage : AuditableEntityBase
{
    /// <summary>
    /// 套餐名称。
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 套餐描述。
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 套餐类型。
    /// </summary>
    public TenantPackageType PackageType { get; set; } = TenantPackageType.Free;

    /// <summary>
    /// 月付价格。
    /// </summary>
    public decimal? MonthlyPrice { get; set; }

    /// <summary>
    /// 年付价格。
    /// </summary>
    public decimal? YearlyPrice { get; set; }

    /// <summary>
    /// 最大门店数。
    /// </summary>
    public int? MaxStoreCount { get; set; }

    /// <summary>
    /// 最大账号数。
    /// </summary>
    public int? MaxAccountCount { get; set; }

    /// <summary>
    /// 最大存储空间（GB）。
    /// </summary>
    public int? MaxStorageGb { get; set; }

    /// <summary>
    /// 最大短信额度。
    /// </summary>
    public int? MaxSmsCredits { get; set; }

    /// <summary>
    /// 最大配送订单数。
    /// </summary>
    public int? MaxDeliveryOrders { get; set; }

    /// <summary>
    /// 功能策略 JSON。
    /// </summary>
    public string? FeaturePoliciesJson { get; set; }

    /// <summary>
    /// 是否启用。
    /// </summary>
    public bool IsActive { get; set; } = true;

    /// <summary>
    /// 排序序号。
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 是否允许新租户购买。
    /// </summary>
    public bool IsAllowNewTenantPurchase { get; set; } = true;

    /// <summary>
    /// 是否公开可见。
    /// </summary>
    public bool IsPublicVisible { get; set; } = true;

    /// <summary>
    /// 发布状态。
    /// </summary>
    public TenantPackagePublishStatus PublishStatus { get; set; } = TenantPackagePublishStatus.Draft;

    /// <summary>
    /// 是否推荐。
    /// </summary>
    public bool IsRecommended { get; set; }

    /// <summary>
    /// 标签列表。
    /// </summary>
    public string[] Tags { get; set; } = [];
}
