screen.model.ts 937 Bytes
Newer Older
Kevin Robert's avatar
Kevin Robert committed
1
2
3
export interface IScreen {
  id?: number;
  name?: string;
4
  nameBo?: string;
5
  reference?: string;
Kevin Robert's avatar
Kevin Robert committed
6
  description?: any;
7
  defaultNextScreenReference?: any;
Kevin Robert's avatar
Kevin Robert committed
8
  items?: any;
9
10
  itemsList?: [];
  index?: number;
11
12
13
14
15
  previousName?: string;
  previousId?: number;
  nextId?: number;
  formName?: string;
  formId?: number;
Kevin Robert's avatar
Kevin Robert committed
16
17
18
19
20
21
}

export class Screen implements IScreen {
  constructor(
    public id?: number,
    public name?: string,
22
    public nameBo?: string,
23
    public reference?: string,
Kevin Robert's avatar
Kevin Robert committed
24
    public description?: any,
25
    public defaultNextScreenReference?: any,
Kevin Robert's avatar
Kevin Robert committed
26
    public items?: any,
27
28
29
30
31
    public previousName?: string,
    public previousId?: number,
    public nextId?: number,
    public formName?: string,
    public formId?: number
Kevin Robert's avatar
Kevin Robert committed
32
33
  ) {}
}
34
35
36
37
38
39

export const screenValidate = {
  validate(screen: IScreen): boolean {
    return screen.name && screen.name.trim().length > 0 && screen.reference && screen.reference.trim().length > 0;
  },
};