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

export default class LethalFantasyEquipment extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    const schema = {}
    const requiredInteger = { required: true, nullable: false, integer: true }

    schema.description = new fields.HTMLField({ required: true, textSearch: true })
    schema.category = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.EQUIPMENT_CATEGORY })

    schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
    schema.hi = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
    schema.medium = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
    schema.lo = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
    schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
    schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })

    return schema
  }

  /** @override */
  static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Equipment"]

}
