intelligentDocking.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // ids详情
  5. const info = new Schema({
  6. jr_id: { type: String, required: false, maxLength: 200 }, // 资料名称
  7. reason: { type: String, required: false, maxLength: 500 }, // 资料链接
  8. });
  9. // 智能对接信息表
  10. const IntelligentDockingSchema = {
  11. uid: { type: String, required: true, maxLength: 200 }, // 企业用户id
  12. // 对接需求
  13. company_name: { type: String, required: true, maxLength: 200 }, // 企业名称
  14. code: { type: String, required: false, maxLength: 200 }, // 统一社会信用代码
  15. person: { type: String, required: true, maxLength: 200 }, // 联系人
  16. phone: { type: String, required: true, maxLength: 200 }, // 手机号
  17. opening_bank: { type: String, required: false, maxLength: 200 }, // 首选开户行
  18. orientation: { type: [ String ], required: true }, // 融资取向
  19. money: { type: String, required: true, maxLength: 200 }, // 融资金额
  20. claims_min_term: { type: String, required: false, maxLength: 200 }, // 融资期限(小)
  21. claims_max_term: { type: String, required: false, maxLength: 200 }, // 融资期限(大)
  22. mongey_min_rate: { type: String, required: false, maxLength: 200 }, // 融资利率(小)
  23. mongey_max_rate: { type: String, required: false, maxLength: 200 }, // 融资利率(小)
  24. ensure_id: { type: String, required: false, maxLength: 200 }, // 担保方式的code(字典表)
  25. ensure_name: { type: String, required: false, maxLength: 200 }, // 担保方式
  26. when: { type: String, required: false, maxLength: 200 }, // 预计何时有融资需求 非必填
  27. additional_information: { type: String, required: false, maxLength: 200 }, // 补充信息 非必填
  28. // 对接结果
  29. create_time: { type: String, required: false, maxLength: 200 }, // 查询时间
  30. cid: { type: String, required: false, maxLength: 200 }, // 对接结果-产品
  31. jg_id: { type: String, required: false, maxLength: 200 }, // 对接结果-银行
  32. // 拒绝
  33. refuse_times: { type: Number, default: 0 }, // 拒绝次数 默认为0
  34. ids: { type: [ info ], required: false }, // 拒绝的银行id,理由
  35. status: { type: String, default: '0' }, // 状态:进行中0,已完成1
  36. };
  37. const schema = new Schema(IntelligentDockingSchema, { toJSON: { virtuals: true } });
  38. schema.index({ id: 1 });
  39. schema.plugin(metaPlugin);
  40. module.exports = app => {
  41. const { mongoose } = app;
  42. return mongoose.model('IntelligentDocking', schema, 'intelligent_docking');
  43. };