projects.js 1.2 KB

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