|
@@ -0,0 +1,41 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
+
|
|
|
+// 专利交易
|
|
|
+const trans = {
|
|
|
+ user_id: { type: String, required: false }, // 申请人id
|
|
|
+ user_name: { type: String, required: false }, // 申请人姓名
|
|
|
+ patent_id: { type: String, required: false }, // 专利id
|
|
|
+ name: { type: String, required: false }, // 专利名称
|
|
|
+ create_number: { type: String, required: false }, // 申请号
|
|
|
+ on_obligee: { type: String, required: false }, // 当前权利人(变更前权利人)
|
|
|
+ contact: { type: String, required: false }, // 联系人
|
|
|
+ phone: { type: String, required: false }, // 联系电话
|
|
|
+ email: { type: String, required: false }, // 电子邮箱
|
|
|
+ money_type: { type: String, required: false }, // 价格类型
|
|
|
+ money_min: { type: String, required: false }, // 最小价格
|
|
|
+ money_max: { type: String, required: false }, // 最大价格
|
|
|
+ type: { type: String, required: false }, // 交易类型
|
|
|
+ is_report: { type: Boolean, required: false }, // 是否有评估报告
|
|
|
+ file: { type: Array, required: false }, // 报告文件
|
|
|
+ abstract: { type: String, required: false }, // 摘要
|
|
|
+ requirementdesc: { type: String, required: false }, // 技术说明
|
|
|
+ expect: { type: String, required: false }, // 商业预期
|
|
|
+ condition: { type: String, required: false }, // 合作条件及要求
|
|
|
+ on_afterobligee: { type: String, required: false }, // 变更后专利权人
|
|
|
+ transfer_date: { type: String, required: false }, // 专利权转移日期
|
|
|
+ contract_type: { type: String, required: false }, // 合同类型
|
|
|
+ contract: { type: Object, required: false }, // 线上合同内容
|
|
|
+ contract_file: { type: Array, required: false }, // 线下合同文件
|
|
|
+ status: { type: String, required: false }, // 0:待审中,1:审核通过,-1:审核未通过,2:合同审核中,3:交易合同审核通过,待用户确认,-3:交易合同审核拒绝,4:用户确定,5:交易完成
|
|
|
+};
|
|
|
+const schema = new Schema(trans, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
+
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Trans', schema, 'trans');
|
|
|
+};
|