Spaces:
Sleeping
Sleeping
Download models/CatalogCategoryModel.js from Mahmoud7456/MultiUsersSalesSystem: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/Mahmoud7456/MultiUsersSalesSystem/resolve/main/models/CatalogCategoryModel.js
- Command line
-
hf download hf://spaces/Mahmoud7456/MultiUsersSalesSystem/models/CatalogCategoryModel.js
-
curl -L -o CatalogCategoryModel.js https://huggingface.co/spaces/Mahmoud7456/MultiUsersSalesSystem/resolve/main/models/CatalogCategoryModel.js
1.07 kB
| import mongoose from "mongoose"; | |
| const catalogCategorySchema = new mongoose.Schema( | |
| { | |
| tenant: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: "Tenant", | |
| required: true, | |
| index: true, | |
| }, | |
| branch: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: "Branch", | |
| default: null, | |
| index: true, | |
| }, | |
| name: { | |
| type: String, | |
| required: true, | |
| trim: true, | |
| }, | |
| description: { | |
| type: String, | |
| default: "", | |
| trim: true, | |
| }, | |
| sortOrder: { | |
| type: Number, | |
| default: 0, | |
| }, | |
| isActive: { | |
| type: Boolean, | |
| default: true, | |
| }, | |
| createdBy: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: "User", | |
| default: null, | |
| }, | |
| }, | |
| { timestamps: true } | |
| ); | |
| catalogCategorySchema.index({ tenant: 1, branch: 1, name: 1 }, { unique: true }); | |
| export default mongoose.model("CatalogCategory", catalogCategorySchema); | |