projects.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*项目*/
  5. const mongoose = require('mongoose');
  6. const Schema = mongoose.Schema;
  7. const deleteSchema = require('../all_schemas/delete_schema');
  8. const collectionName = 'projects';
  9. const shareSchema = new Schema({
  10. userID: String, //userID
  11. allowCopy: {type: Boolean, default: false},
  12. allowCooperate: {type: Boolean, default: false},
  13. shareDate: String,
  14. }, {versionKey: false, _id: false});
  15. const ProjectSchema = new Schema({
  16. "isTwoLevel": { type: Boolean, default: false },
  17. "ID": {type: Number, index: true},
  18. "ParentID": Number,
  19. "NextSiblingID": Number,
  20. "userID": {type:String,index: true},
  21. "importedByInterface": {type: Boolean, default: false},
  22. "code": {type: String, default: ''},
  23. chapterCode: String,
  24. sectionCode: String,
  25. "name": String,
  26. "projType": String,
  27. "recentDateTime": Date,
  28. "createDateTime": Date,
  29. "compilation": String,
  30. "deleteInfo": deleteSchema,
  31. 'fullFolder': Array,
  32. //"shareInfo": [shareSchema],
  33. "property": {
  34. type: Schema.Types.Mixed,
  35. default: {}
  36. },
  37. "summaryFees":{
  38. totalFee: String,
  39. estimateFee: String,
  40. safetyFee: String,
  41. chargeFee: String
  42. },
  43. "changeMark":String,// 更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  44. "remark":String, // 备注
  45. "fileVer": String, // 创建时程序版本号
  46. "lastFileVer": String, // 最新打开并计算时的程序版本号
  47. "compareID":Number
  48. });
  49. mongoose.model(collectionName, ProjectSchema, collectionName);