import { SYSTEM } from "../config/system.mjs";

export default class HamalronCompetence extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    const schema = {};

    schema.description = new fields.HTMLField({ required: true, textSearch: true })
    schema.type = new fields.StringField({ required: true, initial: "commune", choices: Object.fromEntries(Object.entries(SYSTEM.COMPETENCE_TYPES).map(([key, val]) => [key, val.label])) });
    schema.carteSymbole = new fields.StringField({ required: true, initial: "coupe", choices: Object.fromEntries(Object.entries(SYSTEM.TAROT_SYMBOLES).map(([key, val]) => [key, val.label])) });
    schema.niveau = new fields.StringField({ required: true, initial: "inexperimente", choices: Object.fromEntries(Object.entries(SYSTEM.NIVEAU_COMPETENCES).map(([key, val]) => [key, val.name])) });
    schema.faction = new fields.StringField({ required: false, initial: "" });
    schema.peuple = new fields.StringField({ required: false, initial: "" });

    return schema;
  }

  /** @override */
  static LOCALIZATION_PREFIXES = ["HAMALRON.Competence"];
}