|
@@ -5,33 +5,41 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
const { ObjectId } = require('mongoose').Types;
|
|
|
// 价值评估表
|
|
|
const patentassess = {
|
|
|
- admin_id: { type: ObjectId }, // 管理员id
|
|
|
- user_id: { type: ObjectId }, // 用户id
|
|
|
+ user_id: { type: ObjectId, required: false }, // 用户id
|
|
|
+ user_name: { type: String, required: false }, // 用户姓名
|
|
|
+ admin_id: { type: ObjectId, required: false }, // 管理员id
|
|
|
+ admin_name: { type: String, required: false }, // 管理员姓名
|
|
|
patent_id: { type: ObjectId }, // 专利id
|
|
|
- create_number: { type: String }, // 申请号
|
|
|
- patent_name: { type: String }, // 专利名称
|
|
|
- inventor: { type: Array }, // 发明人
|
|
|
+ create_number: { type: String, required: false }, // 申请号
|
|
|
+ patent_name: { type: String, required: false }, // 专利名称
|
|
|
+ inventor: { type: Array, required: false }, // 发明人
|
|
|
type: { type: String, required: false }, // 专利类型
|
|
|
- contact: { type: String }, // 联系人
|
|
|
- phone: { type: String }, // 联系人电话
|
|
|
- email: { type: String }, // 联系人邮箱
|
|
|
+ contact: { type: String, required: false }, // 联系人
|
|
|
+ phone: { type: String, required: false }, // 联系人电话
|
|
|
+ email: { type: String, required: false }, // 联系人邮箱
|
|
|
abstract: { type: String, required: false }, // 摘要
|
|
|
field: { type: String, required: false }, // 应用领域
|
|
|
explain: { type: String, required: false }, // 技术说明
|
|
|
+ shared_value: { type: String, required: false }, // 合享价值度
|
|
|
+ techol_stable: { type: String, required: false }, // 技术稳定性
|
|
|
+ techol_advanced: { type: String, required: false }, // 技术先进性
|
|
|
is_money: { type: Boolean, default: false }, // 是否缴费
|
|
|
+ status: { type: String, default: '0' }, // 状态
|
|
|
report: { type: Array }, // 评估报告
|
|
|
record: { type: Array }, // 记录
|
|
|
- status: { type: String, default: '0' }, // 状态
|
|
|
+
|
|
|
remark: { type: String },
|
|
|
};
|
|
|
const schema = new Schema(patentassess, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
-schema.index({ admin_id: 1 });
|
|
|
schema.index({ user_id: 1 });
|
|
|
+schema.index({ admin_id: 1 });
|
|
|
schema.index({ patent_id: 1 });
|
|
|
schema.index({ create_number: 1 });
|
|
|
+schema.index({ patent_name: 1 });
|
|
|
schema.index({ type: 1 });
|
|
|
schema.index({ is_money: 1 });
|
|
|
+schema.index({ status: 1 });
|
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.plugin(metaPlugin);
|
|
|
module.exports = app => {
|