telegram-shop-api / src /models /Category.js
Deploy Bot
yryh
2d22694
const mongoose = require('mongoose');
const categorySchema = new mongoose.Schema({
id: { type: String, required: true, unique: true },
name: { type: String, required: true },
description: String,
parent: { type: String, default: null } // Parent Category ID
});
module.exports = mongoose.model('Category', categorySchema);