'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const { Secret } = require('naf-framework-mongoose/lib/model/schema'); // 企业修改信息表 const CompanyupSchema = { uid: { type: String, required: true, maxLength: 200 }, // 关联企业用户id company_name: { type: String, required: true, maxLength: 200 }, // 企业名称 // cql reg_num: { type: String, required: true, maxLength: 200 }, // 统一社会信用代码 必填 type: { type: String, required: true, maxLength: 200 }, // 公司类型 必填 address: { type: String, required: true, maxLength: 200 }, // 地址 必填 business: { type: String, required: true, maxLength: 200 }, // 经营范围 必填 capital: { type: String, required: true, maxLength: 200 }, // 注册资本 必填 establish_date: { type: String, required: true, maxLength: 200 }, // 成立日期 必填 valid_period: { type: String, required: true, maxLength: 200 }, // 公司营业期限终止日期 "长期"表示为"29991231" person: { type: String, required: true, maxLength: 200 }, // 法定代表人 必填 // registered_addr: { type: String, required: true, maxLength: 500 }, // 工商注册地址 // business_addr: { type: String, required: true, maxLength: 500 }, // 实际经营地址 // profession_one: { type: String, required: true, maxLength: 200 }, // 所属一级行业 // profession_two: { type: String, required: true, maxLength: 200 }, // 所属二级行业 // profession_three: { type: String, required: true, maxLength: 200 }, // 所属三级行业 // profession_four: { type: String, required: true, maxLength: 200 }, // 所属四级行业 // contacts: { type: String, required: false, maxLength: 200 }, // 融资联系人 // contact_number: { type: String, required: false, maxLength: 200 }, // 联系人手机 // contact_position: { type: String, required: false, maxLength: 200 }, // 联系人职位 // contact_email: { type: String, required: false, maxLength: 200 }, // 联系人邮箱 // telephone: { type: String, required: false, maxLength: 200 }, // 固定电话 status: { type: String, required: false, maxLength: 200, default: '0' }, // 审核状态,0-审核中,1-审核通过,2-审核拒绝 }; const schema = new Schema(CompanyupSchema, { toJSON: { virtuals: true } }); schema.index({ uid: 1 }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Companyup', schema, 'company_up'); };