checkRecord.js 1001 B

12345678910111213141516171819202122232425
  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 check_record = {
  8. apply_id: { type: String }, // 成果申请数据id
  9. desc: { type: String }, // 本次审核的意见
  10. status: { type: String }, // 本次审核的结果
  11. verify_id: { type: String }, // 本次审核人
  12. verify_phone: { type: String }, // 本次审核人的联系电话
  13. verify: { type: String }, // 本次审核人
  14. step: { type: String }, // 初审=>评分=>会审=>资料/发证书
  15. remark: { type: String },
  16. };
  17. const schema = new Schema(check_record, { toJSON: { virtuals: true } });
  18. schema.index({ id: 1 });
  19. schema.index({ apply_id: 1 });
  20. schema.index({ 'meta.createdAt': 1 });
  21. schema.plugin(metaPlugin);
  22. module.exports = app => {
  23. const { mongoose } = app;
  24. return mongoose.model('CheckRecord', schema, 'checkRecord');
  25. };