import { BaseItemDataModel } from "./base-item.mjs"

export default class TribuDataModel extends BaseItemDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    return {
      ...this.defineBaseSchema(),
      keywords: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      mainRace: new fields.StringField({ initial: "" }),
      spokenLanguage: new fields.StringField({ initial: "" }),
      philosophy: new fields.StringField({ initial: "" }),
      pride: new fields.StringField({ initial: "" }),
      mythNature: new fields.StringField({ initial: "" }),
      mythEdenia: new fields.StringField({ initial: "" }),
      territory: new fields.StringField({ initial: "" }),
      specialRules: new fields.HTMLField({ initial: "" }),
      roleplayNotes: new fields.HTMLField({ initial: "" }),
      restrictedJobs: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      allowedJobs: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      skillBonuses: new fields.ArrayField(new fields.SchemaField({
        key: new fields.StringField({ initial: "" }),
        alternativeKeys: new fields.ArrayField(new fields.StringField(), { initial: [] }),
        base: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
        domainsGranted: new fields.ArrayField(new fields.StringField(), { initial: [] }),
        domainsToChoose: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
        domainsChoiceText: new fields.StringField({ initial: "" }),
      }), { initial: [] }),
    }
  }
}
