[SDC-29] catalog 1707 rebase commit.
[sdc.git] / catalog-ui / src / app / models / category.ts
1 'use strict';
2
3
4
5 export class ICategoryBase {
6
7     //server properties
8     name:string;
9     normalizedName:string;
10     uniqueId:string;
11     icons:Array<string>;
12
13     //custom properties
14     filterTerms:string;
15     isDisabled:boolean;
16     filteredGroup:Array<IGroup>;
17
18     constructor(category?:ICategoryBase) {
19         if (category) {
20             this.name = category.name;
21             this.normalizedName = category.normalizedName;
22             this.icons = category.icons;
23             this.filterTerms = category.filterTerms;
24             this.isDisabled = category.isDisabled;
25             this.filteredGroup = category.filteredGroup;
26         }
27     }
28 }
29
30 export class IMainCategory extends ICategoryBase {
31     subcategories:Array<ISubCategory>;
32
33     constructor();
34     constructor(category?:IMainCategory) {
35         super(category);
36         if (category) {
37             this.subcategories = category.subcategories;
38         }
39     }
40 }
41
42 export class ISubCategory extends ICategoryBase {
43     groupings:Array<ICategoryBase>;
44 }
45
46 export interface IGroup extends ICategoryBase {
47 }