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

setGlobalConfig({
  modelAutoTypeChecking: ModelAutoTypeCheckingMode.AlwaysOn,
});
@model('keystone/Settings/Terminal')
export default class Terminal extends Model({
  acs01moduleName: tProp(types.string, ''),
  auxInputTicketButtonId: tProp(types.string, ''),
  auxInputLoopId: tProp(types.string, ''),
  passageId: tProp(types.string, ''),
  printerId: tProp(types.string, ''),
  auxOutputLostTicketId: tProp(types.string, ''), // Lost ticket relais output
  ticketOnLoop: tProp(types.boolean, false),
  scannerConnectedToDisplay: tProp(types.boolean, true),
  lostTicketPrice: tProp(types.string, '50').withSetter(),
  counterIdToCheck: tProp(types.maybe(types.string)),
useParkingCounterLogic: tProp(types.boolean, () => false),
}) {
  @modelAction
  setScannerConnectedToDisplay(scannerConnectedToDisplay: boolean) {
    this.scannerConnectedToDisplay = scannerConnectedToDisplay;
  }

  @modelAction
  setTicketOnLoop(ticketOnLoop: boolean) {
    this.ticketOnLoop = ticketOnLoop;
  }

  @modelAction
  setAuxInputTicketButtonId(auxInputTicketButtonId: string) {
    this.auxInputTicketButtonId = auxInputTicketButtonId;
  }

  @modelAction
  setAuxInputLoopId(auxInputLoopId: string) {
    this.auxInputLoopId = auxInputLoopId;
  }

  @modelAction
  setPassageId(passageId: string) {
    this.passageId = passageId;
  }

  @modelAction
  setPrinterId(printerId: string) {
    this.printerId = printerId;
  }

  @modelAction
  setAuxOutputLostTicketId(auxOutputLostTicketId: string) {
    this.auxOutputLostTicketId = auxOutputLostTicketId;
  }

  @modelAction
  setCounterIdToCheck(counterId: string) {
    this.counterIdToCheck = counterId;
  }

  @modelAction
  setUseParkingCounterLogic(value: boolean) {
    this.useParkingCounterLogic = value;
  }

}
