renhao
2023-09-21 1aa9f2bb83dd9e4b7517f1cbf06b0db53979bb31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { DataHierarchyProvider } from '../../libappsop/datahierarchy';
export enum DataMetalBaseSalesSegmentName {
  AllOrganics = 'All Organics',
  AllSalesSegments = 'All Sales Segments',
  AudiA8 = 'Audi A8',
  Automotive = 'Automotive',
  BMWi3 = 'BMW i3',
  Cans = 'Cans',
  CanManChina = 'CanMan China',
  SpecialCan = 'Special Can',
  Volkswagen = 'Volkswagen',
}
 
const dataSalesSegment = {
  BMW: {Name: {Name: 'BMW'}, Parents: [{Name: DataMetalBaseSalesSegmentName.AllSalesSegments}, {Name: DataMetalBaseSalesSegmentName.Automotive}]},
};
 
/**
 * Define the row name and its immediate parent (no need define all ancestors for easier maintenance and readability).
 * Create a DataHierarchyProvider object to store and query row ancestors to use in spec file.
 */
export const dataFoodSalesSegment = {
  Carrefour: { Name: 'Carrefour', NameKey: 'Carrefour', ParentKey: ''},
  Target: { Name: 'Target', NameKey: 'Target', ParentKey: ''},
 
};
 
export const dataMetalsSalesSegment = {
  AllSalesSegments: { Name: 'All Sales Segments', NameKey: 'AllSalesSegments', ParentKey: ''},
  Cans: { Name: 'Cans', NameKey: 'Cans', ParentKey: 'AllSalesSegments'},
  AsiaSegment: { Name: 'Asia Segment', NameKey: 'AsiaSegment', ParentKey: 'Cans'},
  SpecialCan: { Name: 'Special Can', NameKey: 'SpecialCan', ParentKey: 'AsiaSegment'},
 
};
 
export { dataSalesSegment as DataSalesSegment };
export const dataFoodSalesSegmentProvider: DataHierarchyProvider = new DataHierarchyProvider(dataFoodSalesSegment);
export const dataMetalsSalesSegmentProvider: DataHierarchyProvider = new DataHierarchyProvider(dataMetalsSalesSegment);