const {
    SchemaField,
    NumberField,
    StringField,
    HTMLField,
    FilePathField,
    ArrayField,
} = foundry.data.fields;

export class MerchantDataModel extends foundry.abstract.TypeDataModel {

    static defineSchema() {

        return {
            description: new HTMLField(),
            services: new ArrayField(
                new SchemaField({
                    image: new FilePathField({
                        categories: ["IMAGE"], initial: data => {
                            return this.getDefaultArtwork(data);
                        }
                    }),
                    name: new StringField(),
                    price: new NumberField(),
                    description: new HTMLField(),
                    availability: new NumberField(),
                })
            ),
            // goods are based on Item collection
        }

    }

    static getDefaultArtwork(data) {
        return "icons/commodities/materials/bowl-liquid-red.webp"
    }
}