Foundry and discord bot
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s
This commit is contained in:
28
backend/src/models/Item.js
Normal file
28
backend/src/models/Item.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const ItemSchema = new Schema({
|
||||
name: { type: String, required: true, trim: true },
|
||||
category: {
|
||||
type: String,
|
||||
enum: ['weapon', 'armor', 'shield', 'adventuring-gear', 'magic-item', 'consumable', 'tool', 'treasure', 'other'],
|
||||
default: 'adventuring-gear'
|
||||
},
|
||||
rarity: {
|
||||
type: String,
|
||||
enum: ['common', 'uncommon', 'rare', 'very-rare', 'legendary', 'artifact'],
|
||||
default: 'common'
|
||||
},
|
||||
quantity: { type: Number, min: 1, default: 1 },
|
||||
weight: { type: Number, min: 0 },
|
||||
properties: { type: String, default: '' },
|
||||
description: { type: String, default: '' },
|
||||
campaign: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'Campaign',
|
||||
required: true
|
||||
},
|
||||
date: { type: Date, default: Date.now }
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Item', ItemSchema);
|
||||
Reference in New Issue
Block a user