opendb-department.schema.json 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {
  2. "bsonType": "object",
  3. "required": [
  4. "name"
  5. ],
  6. "permission": {
  7. "read": true,
  8. "create": false,
  9. "update": false,
  10. "delete": false
  11. },
  12. "properties": {
  13. "_id": {
  14. "description": "ID,系统自动生成"
  15. },
  16. "parent_id": {
  17. "bsonType": "string",
  18. "description": "父级部门ID",
  19. "parentKey": "_id"
  20. },
  21. "name": {
  22. "bsonType": "string",
  23. "description": "部门名称",
  24. "title": "部门名称",
  25. "trim": "both"
  26. },
  27. "level": {
  28. "bsonType": "int",
  29. "description": "部门层级,为提升检索效率而作的冗余设计"
  30. },
  31. "sort": {
  32. "bsonType": "int",
  33. "description": "部门在当前层级下的顺序,由小到大",
  34. "title": "显示顺序"
  35. },
  36. "manager_uid": {
  37. "bsonType": "string",
  38. "description": "部门主管的userid, 参考`uni-id-users` 表",
  39. "foreignKey": "uni-id-users._id"
  40. },
  41. "create_date": {
  42. "bsonType": "timestamp",
  43. "description": "部门创建时间",
  44. "forceDefaultValue": {
  45. "$env": "now"
  46. }
  47. }
  48. },
  49. "version": "0.1.0"
  50. }