namespace TakeoutSaaS.TenantApi.Contracts.Store;

/// <summary>
/// 堂食基础设置。
/// </summary>
public sealed class DineInBasicSettingsDto
{
    /// <summary>
    /// Enabled。
    /// </summary>
    public bool Enabled { get; set; }
    /// <summary>
    /// DefaultDiningMinutes。
    /// </summary>
    public int DefaultDiningMinutes { get; set; }
    /// <summary>
    /// OvertimeReminderMinutes。
    /// </summary>
    public int OvertimeReminderMinutes { get; set; }
}

/// <summary>
/// 堂食区域。
/// </summary>
public sealed class DineInAreaDto
{
    /// <summary>
    /// Id。
    /// </summary>
    public string Id { get; set; } = string.Empty;
    /// <summary>
    /// Name。
    /// </summary>
    public string Name { get; set; } = string.Empty;
    /// <summary>
    /// Description。
    /// </summary>
    public string Description { get; set; } = string.Empty;
    /// <summary>
    /// Sort。
    /// </summary>
    public int Sort { get; set; }
}

/// <summary>
/// 堂食桌位。
/// </summary>
public sealed class DineInTableDto
{
    /// <summary>
    /// Id。
    /// </summary>
    public string Id { get; set; } = string.Empty;
    /// <summary>
    /// AreaId。
    /// </summary>
    public string AreaId { get; set; } = string.Empty;
    /// <summary>
    /// Code。
    /// </summary>
    public string Code { get; set; } = string.Empty;
    /// <summary>
    /// Seats。
    /// </summary>
    public int Seats { get; set; }
    /// <summary>
    /// Status。
    /// </summary>
    public string Status { get; set; } = "free";
    /// <summary>
    /// Tags。
    /// </summary>
    public List<string> Tags { get; set; } = [];
}

/// <summary>
/// 堂食设置聚合。
/// </summary>
public sealed class StoreDineInSettingsDto
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// IsConfigured。
    /// </summary>
    public bool IsConfigured { get; set; }
    /// <summary>
    /// BasicSettings。
    /// </summary>
    public DineInBasicSettingsDto? BasicSettings { get; set; }
    /// <summary>
    /// Areas。
    /// </summary>
    public List<DineInAreaDto> Areas { get; set; } = [];
    /// <summary>
    /// Tables。
    /// </summary>
    public List<DineInTableDto> Tables { get; set; } = [];
}

/// <summary>
/// 保存基础设置请求。
/// </summary>
public sealed class SaveStoreDineInBasicSettingsRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// BasicSettings。
    /// </summary>
    public DineInBasicSettingsDto BasicSettings { get; set; } = new();
}

/// <summary>
/// 保存区域请求。
/// </summary>
public sealed class SaveDineInAreaRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// Area。
    /// </summary>
    public DineInAreaDto Area { get; set; } = new();
}

/// <summary>
/// 删除区域请求。
/// </summary>
public sealed class DeleteDineInAreaRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// AreaId。
    /// </summary>
    public string AreaId { get; set; } = string.Empty;
}

/// <summary>
/// 保存桌位请求。
/// </summary>
public sealed class SaveDineInTableRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// Table。
    /// </summary>
    public DineInTableDto Table { get; set; } = new();
}

/// <summary>
/// 删除桌位请求。
/// </summary>
public sealed class DeleteDineInTableRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// TableId。
    /// </summary>
    public string TableId { get; set; } = string.Empty;
}

/// <summary>
/// 批量生成桌位请求。
/// </summary>
public sealed class BatchCreateDineInTablesRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// AreaId。
    /// </summary>
    public string AreaId { get; set; } = string.Empty;
    /// <summary>
    /// CodePrefix。
    /// </summary>
    public string CodePrefix { get; set; } = string.Empty;
    /// <summary>
    /// StartNumber。
    /// </summary>
    public int StartNumber { get; set; }
    /// <summary>
    /// Count。
    /// </summary>
    public int Count { get; set; }
    /// <summary>
    /// Seats。
    /// </summary>
    public int Seats { get; set; }
}

/// <summary>
/// 批量生成桌位结果。
/// </summary>
public sealed class BatchCreateDineInTablesResultDto
{
    /// <summary>
    /// CreatedTables。
    /// </summary>
    public List<DineInTableDto> CreatedTables { get; set; } = [];
}

/// <summary>
/// 复制堂食设置请求。
/// </summary>
public sealed class CopyStoreDineInSettingsRequest
{
    /// <summary>
    /// SourceStoreId。
    /// </summary>
    public string SourceStoreId { get; set; } = string.Empty;
    /// <summary>
    /// TargetStoreIds。
    /// </summary>
    public List<string> TargetStoreIds { get; set; } = [];
}

/// <summary>
/// 复制结果。
/// </summary>
public sealed class CopyStoreDineInSettingsResult
{
    /// <summary>
    /// CopiedCount。
    /// </summary>
    public int CopiedCount { get; set; }
}
