namespace AnalyticsDAL.Query.Warehouse { // Admin CRUD queries for MWAREHOUSEFACTDIMENSION — the DB-backed registry that maps // a FactId to its dimension tables (DIMOU, DimDate, etc.). Reading this table is what // replaced the hardcoded WarehouseDimensionCatalog HashSets in the 20260827 redesign. // MWAREHOUSEFACTDIMENSION uses IDENTITY(1,1) PK so DAL uses ExecuteIdentityAsync for inserts. public static class WarehouseFactDimensionQB { public const string GET_BY_FACT = @" SELECT FACTDIMENSIONID AS FactDimensionId, FACTID AS FactId, DIMENSIONTABLE AS DimensionTable, FACTFKCOLUMN AS FactFkColumn, DIMJOINCOLUMN AS DimJoinColumn, SORTORDER AS SortOrder FROM MWAREHOUSEFACTDIMENSION WHERE FACTID = @FactId AND TENANTID = @TenantId ORDER BY SORTORDER"; public const string INSERT = @" INSERT INTO MWAREHOUSEFACTDIMENSION (FACTID, DIMENSIONTABLE, FACTFKCOLUMN, DIMJOINCOLUMN, SORTORDER, TENANTID) VALUES (@FactId, @DimensionTable, @FactFkColumn, @DimJoinColumn, @SortOrder, @TenantId) SELECT SCOPE_IDENTITY()"; public const string UPDATE = @" UPDATE MWAREHOUSEFACTDIMENSION SET DIMENSIONTABLE = @DimensionTable, FACTFKCOLUMN = @FactFkColumn, DIMJOINCOLUMN = @DimJoinColumn, SORTORDER = @SortOrder WHERE FACTDIMENSIONID = @FactDimensionId AND TENANTID = @TenantId"; public const string DELETE = @" DELETE FROM MWAREHOUSEFACTDIMENSION WHERE FACTDIMENSIONID = @FactDimensionId AND TENANTID = @TenantId"; } }