using System.Collections.Generic;
using AnalyticsDAL.DTO.BIFieldMapping;
using AnalyticsDAL.DTO.Warehouse;
namespace AnalyticsDAL.DTO.BICatalog
{
/// The output of IDatasetResolver.ResolveAsync — everything
/// IAnalysisAggregationService needs to execute a definition, without needing to know
/// which of the three underlying kinds it is.
public class DatasetResolutionDTO
{
public int BICatalogId { get; set; }
public DatasetKind Kind { get; set; }
public bool IsShared { get; set; }
// Kind == AnalysisQuery
public int? AnalysisId { get; set; }
public int? AnalysisQueryId { get; set; }
public int? ReportViewId { get; set; }
public int? ResolvedDataSourceId { get; set; }
// Kind == Warehouse
public int? FactId { get; set; }
public string? FactTableName { get; set; }
public string? DateDimColumn { get; set; }
public string? OuDimColumn { get; set; }
public List? Measures { get; set; }
// Kind == ApiService
public int? DataSourceId { get; set; }
public string? ResourcePath { get; set; }
public bool RequiresInMemoryGrouping { get; set; }
// Server-side field registry (MBIFIELDMAPPING), mirroring Warehouse's Measures
// above — lets ValidateAdditivity trust a real registry instead of the caller-supplied
// Aggregation/Additivity on the request, closing the same trust gap Warehouse-kind
// measures already have via MWAREHOUSEMEASURE.
public List? ApiMeasures { get; set; }
public int WorkspaceId { get; set; }
// MBIFIELDMAPPING rows with MAPPEDAS = 2 (Computed) for this catalog -- the declarative
// post-resolution expression layer, common to ALL three DatasetKinds (unlike ApiMeasures
// above, which is ApiService-only). Populated unconditionally in DatasetResolver.
// ResolveAsync BEFORE the kind switch, so no IDatasetResolver implementation needs to know
// computed fields exist. See AnalyticsBLL/AnalysisAggregation/ComputedFieldPlanner.cs.
public List? ComputedFields { get; set; }
}
}