import {
  model,
  Model,
  ModelAutoTypeCheckingMode,
  setGlobalConfig,
  tProp,
  types,
} from 'mobx-keystone';
import { v4 as uuidv4 } from 'uuid';

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

@model('keystone/Reports/Report')
export default class Report extends Model({
  id: tProp(types.string, () => uuidv4()),
  date: tProp(types.number, () => new Date().getTime()),
  type: tProp(types.string),
  subType: tProp(types.string),
  name: tProp(types.string),
  site: tProp(types.string),
  account: tProp(types.string),
  counterName: tProp(types.string),
  counterValue: tProp(types.number),
}) {}
