patentassess.js 987 B

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 专利评估表
  7. const patentassess = {
  8. user_id: { type: ObjectId }, // 用户id
  9. patent_id: { type: ObjectId }, // 专利id
  10. patent_name: { type: String }, // 专利名称
  11. is_money: { type: Boolean, default: false }, // 是否缴费
  12. expert: { type: Array }, // 专家
  13. report: { type: String }, // 评估报告
  14. status: { type: String }, // 状态
  15. remark: { type: String },
  16. };
  17. const schema = new Schema(patentassess, { toJSON: { virtuals: true } });
  18. schema.index({ id: 1 });
  19. schema.index({ user_id: 1 });
  20. schema.index({ patent_id: 1 });
  21. schema.index({ is_money: 1 });
  22. schema.index({ 'meta.createdAt': 1 });
  23. schema.plugin(metaPlugin);
  24. module.exports = app => {
  25. const { mongoose } = app;
  26. return mongoose.model('Patentassess', schema, 'patent_assess');
  27. };