companyidentify.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 CompanyidentifySchema = {
  7. uid: { type: String, required: true, maxLength: 200 }, // 关联企业用户id 必填
  8. company_name: { type: String, required: true, maxLength: 200 }, // 企业名称 必填
  9. reg_num: { type: String, required: true, maxLength: 200 }, // 统一社会信用代码 必填
  10. type: { type: String, required: true, maxLength: 200 }, // 公司类型 必填
  11. address: { type: String, required: true, maxLength: 200 }, // 地址 必填
  12. business: { type: String, required: true, maxLength: 200 }, // 经营范围 必填
  13. capital: { type: String, required: true, maxLength: 200 }, // 注册资本 必填
  14. establish_date: { type: String, required: true, maxLength: 200 }, // 成立日期 必填
  15. valid_period: { type: String, required: true, maxLength: 200 }, // 公司营业期限终止日期 "长期"表示为"29991231"
  16. person: { type: String, required: true, maxLength: 200 }, // 法定代表人 必填
  17. opening_bank: { type: String, required: true, maxLength: 200 }, // 开户行 必填
  18. status: { type: String, required: false, maxLength: 200, default: '1' }, // 认证状态,0-认证中,1-认证通过,2-认证失败 改为默认认证通过
  19. // business_license: { type: String, required: false, maxLength: 200 }, // 营业执照图片
  20. // establish_date: { type: String, required: false, maxLength: 200 }, // 成立日期
  21. // due_date: { type: String, required: false, maxLength: 200 }, // 营业到期日期
  22. // type: { type: String, required: false, maxLength: 200 }, // 企业类型
  23. // registered_capital: { type: String, required: false, maxLength: 200 }, // 注册资本
  24. // total_assets: { type: String, required: false, maxLength: 200 }, // 资产总额
  25. // taking: { type: String, required: false, maxLength: 200 }, // 营业收入
  26. // number: { type: String, required: false, maxLength: 200 }, // 从业人员数量
  27. // belong_type: { type: String, required: false, maxLength: 200 }, // 企业所属类型
  28. profession_one: { type: String, required: false, maxLength: 200 }, // 所属一级行业
  29. profession_two: { type: String, required: false, maxLength: 200 }, // 所属二级行业
  30. profession_three: { type: String, required: false, maxLength: 200 }, // 所属三级行业
  31. profession_four: { type: String, required: false, maxLength: 200 }, // 所属四级行业
  32. belong_addr_city: { type: String, required: false, maxLength: 200 }, // 企业所属地-市
  33. belong_addr_area: { type: String, required: false, maxLength: 200 }, // 企业所属地-区
  34. // business_addr: { type: String, required: false, maxLength: 200 }, // 经营地址
  35. // registered_addr: { type: String, required: false, maxLength: 200 }, // 注册地址
  36. // business_scope: { type: String, required: false, maxLength: 200 }, // 经营范围
  37. // introduction: { type: String, required: false }, // 企业简介
  38. // card_front: { type: String, required: false, maxLength: 200 }, // 身份证正面图
  39. // card_back: { type: String, required: false, maxLength: 200 }, // 身份证背面图
  40. // representative: { type: String, required: false, maxLength: 200 }, // 法定代表人
  41. // representative_id: { type: String, required: false, maxLength: 200 }, // 法人证件号
  42. // representative_phone: { type: String, required: false, maxLength: 200 }, // 法人手机号
  43. // status: { type: String, required: false, maxLength: 200, default: '0' }, // 认证状态,0-认证中,1-认证通过,2-认证失败
  44. };
  45. const schema = new Schema(CompanyidentifySchema, { toJSON: { virtuals: true } });
  46. schema.index({ id: 1 });
  47. schema.index({ uid: 1 });
  48. schema.plugin(metaPlugin);
  49. module.exports = app => {
  50. const { mongoose } = app;
  51. return mongoose.model('Companyidentify', schema, 'company_identify');
  52. };