projects.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. "importedByInterface": {type: Boolean, default: false},
  21. "code": {type: String, default: ''},
  22. "name": String,
  23. "projType": String,
  24. "recentDateTime": Date,
  25. "createDateTime": Date,
  26. "compilation": String,
  27. "deleteInfo": deleteSchema,
  28. 'fullFolder': Array,
  29. //"shareInfo": [shareSchema],
  30. "property": {
  31. type: Schema.Types.Mixed,
  32. default: {}
  33. },
  34. "summaryFees":{
  35. totalFee: String,
  36. estimateFee: String,
  37. safetyFee: String,
  38. chargeFee: String
  39. },
  40. "changeMark":String,// 更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  41. "remark":String, // 备注
  42. "fileVer": String, // 创建时程序版本号
  43. "lastFileVer": String // 最新打开并计算时的程序版本号
  44. });
  45. mongoose.model(collectionName, ProjectSchema, collectionName);