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

    schema.description = new fields.HTMLField({ required: true, textSearch: true })
    schema.usesMax = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
    schema.uses = new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
    schema.quantity = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
    schema.encLoad = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
    schema.cost = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
    schema.notes = new fields.HTMLField({ required: true })
    schema.containerId = new fields.StringField({ required: false, initial: "", nullable: false })

    return schema
  }

  /** @override */
  static LOCALIZATION_PREFIXES = ["PRISMRPG.Consumable"]
}
