39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
const {
|
|
SchemaField,
|
|
NumberField,
|
|
ObjectField,
|
|
StringField,
|
|
HTMLField,
|
|
FilePathField,
|
|
DocumentIdField,
|
|
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"
|
|
}
|
|
} |