import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
import { INTEGER, STRING } from "../common/field-types.mjs";

const fields = foundry.data.fields;

export default class RdDModelLivre extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    return Object.assign({},
      TEMPLATE_DESCRIPTION.fields(),
      TEMPLATE_INVENTAIRE.fields(),
      {
        lu: new fields.BooleanField({ label: "Lu", initial: false }),
        estCopieLue: new fields.BooleanField({ label: "Copie lue", initial: false }),
        competence: new fields.StringField({ label: "Compétence", initial: "", ...STRING }),
        auteur: new fields.StringField({ label: "Auteur", initial: "", ...STRING }),
        difficulte: new fields.NumberField({ label: "Difficulté", initial: 0, ...INTEGER }),
        points_de_tache: new fields.NumberField({ label: "Points de tâche", initial: 0, ...INTEGER }),
        xp: new fields.StringField({ label: "XP", initial: "", ...STRING }),
        niveau_minimum: new fields.NumberField({ label: "Niveau minimum", initial: 0, ...INTEGER }),
        niveau_maximum: new fields.NumberField({ label: "Niveau maximum", initial: 0, ...INTEGER }),
      }
    )
  }
}
