finito spero
This commit is contained in:
parent
3ea07942c6
commit
54d4faca9d
12 changed files with 7315 additions and 70 deletions
|
@ -5,6 +5,7 @@ export interface IItem extends Document {
|
|||
name: string;
|
||||
description: string;
|
||||
tags: Types.Array<ITag['_id']>;
|
||||
quantity: number; // ← nuovo
|
||||
dateAdded: Date;
|
||||
addedBy: string;
|
||||
}
|
||||
|
@ -13,8 +14,9 @@ const itemSchema = new Schema<IItem>({
|
|||
name: { type: String, required: true },
|
||||
description: { type: String, required: true },
|
||||
tags: [{ type: Schema.Types.ObjectId, ref: 'Tag' }],
|
||||
quantity: { type: Number, default: 0, min: 0 }, // default 0, mai negativo
|
||||
dateAdded: { type: Date, default: Date.now },
|
||||
addedBy: { type: String }
|
||||
addedBy: { type: String },
|
||||
});
|
||||
|
||||
export default model<IItem>('Item', itemSchema);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue