21 lines
544 B
TypeScript
21 lines
544 B
TypeScript
import { Schema, Document } from "mongoose";
|
|
import MainModel from "../../connect/mongoose.ts";
|
|
export interface Product extends Document {
|
|
productName: string;
|
|
productId: string;
|
|
eventsData: [];
|
|
isArchive: boolean;
|
|
}
|
|
|
|
const ProductSchema = new Schema({
|
|
productName: { type: String, required: true },
|
|
productId: { type: String, required: true },
|
|
isArchive: { type: Boolean, default: false },
|
|
});
|
|
|
|
const ProductModel = (db: string) => {
|
|
return MainModel(db, "Product", ProductSchema, "Product");
|
|
};
|
|
|
|
export default ProductModel;
|