namespace TakeoutSaaS.TenantApi.Contracts.Marketing;

/// <summary>
/// 营销日历总览查询请求。
/// </summary>
public sealed class MarketingCalendarOverviewRequest
{
    /// <summary>
    /// 门店 ID。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;

    /// <summary>
    /// 年份。
    /// </summary>
    public int Year { get; set; }

    /// <summary>
    /// 月份（1-12）。
    /// </summary>
    public int Month { get; set; }
}

/// <summary>
/// 营销日历总览响应。
/// </summary>
public sealed class MarketingCalendarOverviewResponse
{
    public string Month { get; set; } = string.Empty;

    public int Year { get; set; }

    public int MonthValue { get; set; }

    public string MonthStartDate { get; set; } = string.Empty;

    public string MonthEndDate { get; set; } = string.Empty;

    public int TodayDay { get; set; }

    public List<MarketingCalendarDayResponse> Days { get; set; } = [];

    public List<MarketingCalendarLegendResponse> Legends { get; set; } = [];

    public MarketingCalendarStatsResponse Stats { get; set; } = new();

    public MarketingCalendarConflictBannerResponse? ConflictBanner { get; set; }

    public List<MarketingCalendarConflictResponse> Conflicts { get; set; } = [];

    public List<MarketingCalendarActivityResponse> Activities { get; set; } = [];
}

public sealed class MarketingCalendarDayResponse
{
    public int Day { get; set; }

    public bool IsWeekend { get; set; }

    public bool IsToday { get; set; }
}

public sealed class MarketingCalendarLegendResponse
{
    public string Type { get; set; } = string.Empty;

    public string Label { get; set; } = string.Empty;

    public string Color { get; set; } = string.Empty;
}

public sealed class MarketingCalendarStatsResponse
{
    public int TotalActivityCount { get; set; }

    public int OngoingCount { get; set; }

    public int MaxConcurrentCount { get; set; }

    public decimal EstimatedDiscountAmount { get; set; }
}

public sealed class MarketingCalendarActivityResponse
{
    public string ActivityId { get; set; } = string.Empty;

    public string SourceType { get; set; } = string.Empty;

    public string SourceId { get; set; } = string.Empty;

    public string CalendarType { get; set; } = string.Empty;

    public string Name { get; set; } = string.Empty;

    public string Color { get; set; } = string.Empty;

    public string Summary { get; set; } = string.Empty;

    public string DisplayStatus { get; set; } = string.Empty;

    public bool IsDimmed { get; set; }

    public string StartDate { get; set; } = string.Empty;

    public string EndDate { get; set; } = string.Empty;

    public decimal EstimatedDiscountAmount { get; set; }

    public List<MarketingCalendarActivityBarResponse> Bars { get; set; } = [];

    public MarketingCalendarActivityDetailResponse Detail { get; set; } = new();
}

public sealed class MarketingCalendarActivityBarResponse
{
    public string BarId { get; set; } = string.Empty;

    public int StartDay { get; set; }

    public int EndDay { get; set; }

    public string Label { get; set; } = string.Empty;

    public bool IsMilestone { get; set; }

    public bool IsDimmed { get; set; }
}

public sealed class MarketingCalendarActivityDetailResponse
{
    public string ModuleName { get; set; } = string.Empty;

    public string Description { get; set; } = string.Empty;

    public List<MarketingCalendarDetailFieldResponse> Fields { get; set; } = [];
}

public sealed class MarketingCalendarDetailFieldResponse
{
    public string Label { get; set; } = string.Empty;

    public string Value { get; set; } = string.Empty;
}

public sealed class MarketingCalendarConflictBannerResponse
{
    public string ConflictId { get; set; } = string.Empty;

    public int StartDay { get; set; }

    public int EndDay { get; set; }

    public int ActivityCount { get; set; }

    public int MaxConcurrentCount { get; set; }

    public int ConflictCount { get; set; }
}

public sealed class MarketingCalendarConflictResponse
{
    public string ConflictId { get; set; } = string.Empty;

    public int StartDay { get; set; }

    public int EndDay { get; set; }

    public int ActivityCount { get; set; }

    public int MaxConcurrentCount { get; set; }

    public List<string> ActivityIds { get; set; } = [];

    public List<MarketingCalendarConflictActivityResponse> Activities { get; set; } = [];
}

public sealed class MarketingCalendarConflictActivityResponse
{
    public string ActivityId { get; set; } = string.Empty;

    public string CalendarType { get; set; } = string.Empty;

    public string Name { get; set; } = string.Empty;

    public string Summary { get; set; } = string.Empty;

    public string Color { get; set; } = string.Empty;

    public string DisplayStatus { get; set; } = string.Empty;
}
