companyup.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 CompanyupSchema = {
  7. uid: { type: String, required: true, maxLength: 200 }, // 关联企业用户id
  8. company_name: { type: String, required: true, maxLength: 200 }, // 企业名称
  9. // cql
  10. reg_num: { type: String, required: true, maxLength: 200 }, // 统一社会信用代码 必填
  11. type: { type: String, required: true, maxLength: 200 }, // 公司类型 必填
  12. address: { type: String, required: true, maxLength: 200 }, // 地址 必填
  13. business: { type: String, required: true, maxLength: 200 }, // 经营范围 必填
  14. capital: { type: String, required: true, maxLength: 200 }, // 注册资本 必填
  15. establish_date: { type: String, required: true, maxLength: 200 }, // 成立日期 必填
  16. valid_period: { type: String, required: true, maxLength: 200 }, // 公司营业期限终止日期 "长期"表示为"29991231"
  17. person: { type: String, required: true, maxLength: 200 }, // 法定代表人 必填
  18. // registered_addr: { type: String, required: true, maxLength: 500 }, // 工商注册地址
  19. // business_addr: { type: String, required: true, maxLength: 500 }, // 实际经营地址
  20. // profession_one: { type: String, required: true, maxLength: 200 }, // 所属一级行业
  21. // profession_two: { type: String, required: true, maxLength: 200 }, // 所属二级行业
  22. // profession_three: { type: String, required: true, maxLength: 200 }, // 所属三级行业
  23. // profession_four: { type: String, required: true, maxLength: 200 }, // 所属四级行业
  24. // contacts: { type: String, required: false, maxLength: 200 }, // 融资联系人
  25. // contact_number: { type: String, required: false, maxLength: 200 }, // 联系人手机
  26. // contact_position: { type: String, required: false, maxLength: 200 }, // 联系人职位
  27. // contact_email: { type: String, required: false, maxLength: 200 }, // 联系人邮箱
  28. // telephone: { type: String, required: false, maxLength: 200 }, // 固定电话
  29. status: { type: String, required: false, maxLength: 200, default: '0' }, // 审核状态,0-审核中,1-审核通过,2-审核拒绝
  30. };
  31. const schema = new Schema(CompanyupSchema, { toJSON: { virtuals: true } });
  32. schema.index({ uid: 1 });
  33. schema.index({ id: 1 });
  34. schema.plugin(metaPlugin);
  35. module.exports = app => {
  36. const { mongoose } = app;
  37. return mongoose.model('Companyup', schema, 'company_up');
  38. };