daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. type Query {
  2.   user(id: ID!): [User]
  3.   users: [User]
  4. }
  5.  
  6. # An ISO-8601 encoded UTC date string.
  7. scalar DateTime
  8.  
  9. enum LoginType {
  10.   IN
  11.   OUT
  12. }
  13.  
  14. type Account {
  15.   id: ID!
  16.   resourceType: String! # 'Account'
  17.   name: String!
  18.   description: String
  19.   users: [User]
  20.   IsActive: Boolean!
  21.   createdAt: DateTime!
  22. }
  23.  
  24. type User {
  25.   id: ID!
  26.   resourceType: String! # 'User'
  27.   firstName: String
  28.   lastName: String
  29.   login: String!
  30.   password: String
  31.   phone: String
  32.   email: String
  33.   IsActive: Boolean!
  34.   avatarUrl: String
  35.   department: String # tohle patri do organizacni struktury
  36.   createdAt: DateTime!
  37.  
  38.   # Resource references
  39.   lastLogin: LoginLog # max time from LoginLog where type is 'IN'
  40.  
  41.   # Resource collections
  42.   assignments: [Assignment]
  43.   role: [Role] # M:N tohle patri do opravneni
  44. }
  45.  
  46. # Base fields for everything
  47. interface Resource {
  48.   id: ID!
  49.   resourceType: String!
  50.   account: Account
  51.   createdAt: DateTime!
  52. }
  53.  
  54. # Base format for data generated by the user. Such as Requirement, Asset, Risk, etc.
  55. interface Entity {
  56.   version: ID!
  57.   entityType: String!
  58.   name: String!
  59.   description: String
  60.  
  61.   # Resource references
  62.   account: Account
  63.   author: User!
  64.  
  65.   # Resource collections
  66.   parents: [Entity]
  67.   assignments: [Assignment] # TODO: Patri owner sem, nebo ma mit samostatnou kolonku?
  68. #  relations: [Relation]
  69. #  comments: [Comment]
  70. #  versions: [Version]
  71. #  activities: [Activity]
  72. }
  73.  
  74. interface Precaution {
  75.   # Resource references
  76.   parentRisks: [Risk]
  77.   indicators: [Indicator]
  78. }
  79.  
  80. interface Asset {
  81.   # TODO: Maji activa nejaka specialni pole?
  82. }
  83.  
  84. type Assignment implements Resource {
  85.   id: ID!
  86.   resourceType: String! # 'Assignment'
  87.   createdAt: DateTime!
  88.  
  89.   # Resource references
  90.   account: Account
  91.   user: User!
  92.   role: Role!
  93.   entity: Entity!
  94. }
  95.  
  96. type Role implements Resource {
  97.   id: ID!
  98.   resourceType: String! # 'Role'
  99.   name: String!
  100.   description: String
  101.   createdAt: DateTime!
  102.  
  103.   # Resource references
  104.   account: Account
  105. }
  106.  
  107. type LoginLog implements Resource {
  108.   id: ID!
  109.   resourceType: String! # 'LoginLog'
  110.   createdAt: DateTime!
  111.  
  112.   # Resource references
  113.   account: Account
  114.   user: User!
  115.   type: LoginType!
  116. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top