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: "generale", 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.NumberField({ required: true, initial: 0, min: 0, integer: true });

    return schema;
  }

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