import { listItemSchema } from "./_shared.mjs"

/**
 * DataModel pour les items de type "background" (historiques, origines).
 * @augments {foundry.abstract.TypeDataModel}
 */
export default class VermineBackgroundData extends foundry.abstract.TypeDataModel {
  /** @override */
  static LOCALIZATION_PREFIXES = ["VERMINE.item.background"]

  /** @override */
  static defineSchema() {
    const fields = foundry.data.fields
    const reqInt = { required: true, nullable: false, integer: true }
    return {
      ...listItemSchema(),
      cost: new fields.NumberField({ ...reqInt, initial: 1, min: 0 }),
      asterisk: new fields.BooleanField({ required: true, initial: false }),
      learned: new fields.BooleanField({ required: true, initial: false })
    }
  }
}
