projects.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. "ID": {type: Number, index: true},
  17. "ParentID": Number,
  18. "NextSiblingID": Number,
  19. "userID": String,
  20. "code": {type: String, default: ''},
  21. "name": String,
  22. "projType": String,
  23. "recentDateTime": Date,
  24. "createDateTime": Date,
  25. "compilation": String,
  26. "deleteInfo": deleteSchema,
  27. 'fullFolder': Array,
  28. "shareInfo": [shareSchema],
  29. "property": {
  30. type: Schema.Types.Mixed,
  31. default: {}
  32. },
  33. "summaryFees":{
  34. totalFee: String,
  35. estimateFee: String,
  36. safetyFee: String,
  37. chargeFee: String
  38. },
  39. "changeMark":String,//更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  40. "remark":String, //备注
  41. "fileVer": String
  42. });
  43. mongoose.model(collectionName, ProjectSchema, collectionName);