claimneed.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  5. // 债权融资需求表
  6. const ClaimNeedSchema = {
  7. money: { type: Number, required: true, maxLength: 200 }, // 融资金额
  8. use: { type: String, required: true, maxLength: 100}, //融资用途
  9. mongey_min_rate: { type: Number, required: true, maxLength: 200 }, // 期望利率范围(小)
  10. mongey_max_rate: { type: Number, required: true, maxLength: 200 }, // 期望利率范围(大)
  11. claims_min_term: { type: Number, required: true, maxLength: 500 }, // 期望融资期限(小)
  12. claims_max_term: { type: Number, required: true, maxLength: 500 }, // 期望融资期限(大)
  13. ensure_id: { type: String, required: true, maxLength: 200 }, // 担保方式(应该是担保字典ID)
  14. project_status: { type: String}, // 项目情况
  15. remarks: { type: String}, // 备注
  16. jg_id: { type: String, maxLength: 200 ,default:'0'}, //金融机构ID(非定向默认为:0)
  17. jg_pro_id: { type: String, maxLength: 200,default:'0'}, // 产品ID(非定向默认为:0)
  18. cdata: { type: String, maxLength: 200}, // 辅助资料(文件URL)
  19. userid: { type: String, required: true, maxLength: 200},//企业ID
  20. status: { type: String, maxLength: 200,default:'0'}//0 存在 1 删除
  21. };
  22. const schema = new Schema(ClaimNeedSchema, { toJSON: { virtuals: true } });
  23. schema.index({ userid: 1 });
  24. schema.index({ jg_id: 1 });
  25. schema.index({ jg_pro_id: 1 });
  26. schema.plugin(metaPlugin);
  27. module.exports = app => {
  28. const { mongoose } = app;
  29. return mongoose.model('Claimneed', schema, 'claim_need');
  30. };