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

namespace TakeoutSaaS.Domain.Ordering.Entities;

/// <summary>
/// 用户购物车，按租户/门店隔离。
/// </summary>
public sealed class ShoppingCart : MultiTenantEntityBase
{
    /// <summary>
    /// 用户标识。
    /// </summary>
    public long UserId { get; set; }

    /// <summary>
    /// 门店标识。
    /// </summary>
    public long StoreId { get; set; }

    /// <summary>
    /// 购物车状态，包含正常/锁定。
    /// </summary>
    public ShoppingCartStatus Status { get; set; } = ShoppingCartStatus.Active;

    /// <summary>
    /// 桌码或场景标识（扫码点餐）。
    /// </summary>
    public string? TableContext { get; set; }

    /// <summary>
    /// 履约方式（堂食/自提/配送）缓存。
    /// </summary>
    public string? DeliveryPreference { get; set; }

    /// <summary>
    /// 最近一次修改时间（UTC）。
    /// </summary>
    public DateTime LastModifiedAt { get; set; } = DateTime.UtcNow;
}
