Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
import { DropDownStringListSOP } from '../../libappsop/dropdownstringlistsop';
import { ButtonSOP } from '../../libappsop/buttonsop';
import { DialogSOP } from '../../libappsop/dialogsop';
import { CheckboxSOP } from '../../libappsop/checkboxsop';
 
export interface DialogGeneralSettingFields {
  UsableIfExpired?: string;
  UsableIfMature?: string;
  ForecastNetting?: string;
}
 
export class FormGeneralSettings extends DialogSOP<DialogGeneralSettingFields> {
  public readonly msgRerunOptOnChangeForecastNetting = 'Please run the optimizer again to get the updated plan with the new Forecast netting settings.';
  public cbIsUsableIfExpiredWithinPeriod = new CheckboxSOP('CheckBoxIsUsableIfExpiredWithinPeriod');
  public cbIsUsableIfMatureWithinPeriod = new CheckboxSOP('CheckBoxIsUsableIfMatureWithinPeriod');
  public ddslForecastNetting = new DropDownStringListSOP('DropDownStringListForecastNetting');
 
  public btnApply = new ButtonSOP('ButtonApply');
 
  public constructor() {
    super('FormGeneralSettings');
 
    this._uiMap.set('UsableIfExpired', this.cbIsUsableIfExpiredWithinPeriod);
    this._uiMap.set('UsableIfMature', this.cbIsUsableIfMatureWithinPeriod);
    this._uiMap.set('ForecastNetting', this.ddslForecastNetting);
  }
}
 
export enum DefaultForecastNettingRule {
  ForecastBased = 'Forecast-based',
  NoNetting = 'No netting',
}