import { toJS } from 'mobx';
import {
  model,
  Model,
  ModelAutoTypeCheckingMode,
  setGlobalConfig,
  tProp,
  types,
} from 'mobx-keystone';

setGlobalConfig({
  modelAutoTypeChecking: ModelAutoTypeCheckingMode.AlwaysOn,
});

@model('keystone/Remote/Acs01/Scenario')
export default class Scenario extends Model({
  id: tProp(types.string),
  name: tProp(types.string),
  type: tProp(types.number),
  trigger: tProp(
    types.object(() => ({
      id: types.string,
      source: types.number,
    }))
  ),
}) {
  get self() {
    return toJS(this);
  }
}
