using TakeoutSaaS.Domain.Finance.Enums;
using TakeoutSaaS.Domain.Finance.Models;

namespace TakeoutSaaS.Domain.Finance.Repositories;

/// <summary>
/// 成本管理仓储契约。
/// </summary>
public interface IFinanceCostRepository
{
    /// <summary>
    /// 获取成本录入页月度快照。
    /// </summary>
    Task<FinanceCostMonthSnapshot> GetMonthSnapshotAsync(
        long tenantId,
        FinanceCostDimension dimension,
        long? storeId,
        DateTime costMonth,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// 保存月度成本录入快照。
    /// </summary>
    Task SaveMonthSnapshotAsync(
        long tenantId,
        FinanceCostDimension dimension,
        long? storeId,
        DateTime costMonth,
        IReadOnlyList<FinanceCostCategorySnapshot> categories,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// 获取成本分析页快照。
    /// </summary>
    Task<FinanceCostAnalysisSnapshot> GetAnalysisSnapshotAsync(
        long tenantId,
        FinanceCostDimension dimension,
        long? storeId,
        DateTime costMonth,
        int trendMonthCount,
        CancellationToken cancellationToken = default);
}
