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

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

    schema.description = new fields.HTMLField({ required: true, textSearch: true })
    schema.keyAttribute = new fields.StringField({
      required: true,
      nullable: false,
      initial: "agility",
      choices: Object.keys(SYSTEM.ATTRIBUTES)
    })
    schema.keyAttribute2 = new fields.StringField({
      required: false,
      nullable: true,
      initial: null,
      choices: [...Object.keys(SYSTEM.ATTRIBUTES), null]
    })
    schema.specializations = new fields.ArrayField(new fields.StringField())
    schema.knowledgeBonus = new fields.StringField({ initial: "", required: false, nullable: true })

    return schema
  }
}
