"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addStorePlugin = void 0;
const addStorePlugin = (schema, options) => {
    schema.pre("save", function () {
    });
    schema.post("validate", function (docs, next) {
        if (!docs.store_id) {
            const err = new Error("STORE_NOT_EXISTS");
            console.log("STORE_NOT_EXISTS", docs, options);
            next(err);
        }
        return next();
    });
};
exports.addStorePlugin = addStorePlugin;
