export default class CompagnieDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    return {
      description: new fields.HTMLField({ initial: "" }),
      notes: new fields.HTMLField({ initial: "" }),
      captainId: new fields.StringField({ initial: "" }),
      memberIds: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      ombreDuTourmentId: new fields.StringField({ initial: "" }),
      power: new fields.SchemaField({
        name: new fields.StringField({ initial: "" }),
        description: new fields.HTMLField({ initial: "" }),
        sharedDreamPoints: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
        activationCondition: new fields.StringField({ initial: "À portée de vue du capitaine" }),
        captainVisible: new fields.BooleanField({ initial: true }),
        captainNeedsWitness: new fields.BooleanField({ initial: true }),
      }),
      links: new fields.ArrayField(new fields.SchemaField({
        sourceId: new fields.StringField({ initial: "" }),
        targetId: new fields.StringField({ initial: "" }),
        label: new fields.StringField({ initial: "" }),
        details: new fields.StringField({ initial: "" }),
      }), { initial: [] }),
      reserves: new fields.SchemaField({
        songesThreads: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
        cauchemarThreads: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
        emptyGlobes: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
      }),
    }
  }
}
