review_expert.js 905 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 评审专家表
  7. const review_expert = {
  8. expert_id: { type: String, required: false }, // 专家id
  9. apply_id: { type: String, required: false }, // 成果申请id
  10. verify: { type: Object }, // 评审详情:分数:score;意见:content
  11. type: { type: String }, // 工作类型:1=>评分;2=>会审
  12. remark: { type: String },
  13. };
  14. const schema = new Schema(review_expert, { toJSON: { virtuals: true } });
  15. schema.index({ id: 1 });
  16. schema.index({ expert_id: 1 });
  17. schema.index({ apply_id: 1 });
  18. schema.index({ 'meta.createdAt': 1 });
  19. schema.plugin(metaPlugin);
  20. module.exports = app => {
  21. const { mongoose } = app;
  22. return mongoose.model('Review_expert', schema, 'review_expert');
  23. };