Preparing a good schema

Hi All

I am fairly new to Dgraph and now I am designing a schema to maintain the following:
I have 2 types and 1 enum to start with. First type is “Company” and 2nd is “Users”.
Enum is basically different roles for company like “Admin”, “Manager”, “User”

How can i maintain the relation “Company” has these “Roles” and each role has a list of “Users”?

enum Roles {
Admin
Manager
User
}

type User{
id:ID!
name:String @search(by: [hash])
age: Int
designation: String @search(by: [hash])
}

type Company {
id: ID!
name: String @search(by: [hash])
users: <<how to manage ROLES → LIST OF USERS>>
}

Appreciate if anyone could help me here.

Assuming that a company, role, and user refer to one specific entity (Sebastian-User-Dgraph) then I would model the schema as:

type Company {
  id: ID!
  name: String @search(by: [hash])
  hasRoles: [Role]
}
type User {
  id: ID!
  name: String @search(by: [hash])
  age: Int
  fillsRoles: [Role]
}
enum Roles {
  Admin
  Manager
  User
}
type Role {
  id: ID!
  role: Roles
  user: User @hasInverse(field: "fillsRoles")
  company: Company @hasInverse(field: "hasRoles")
}

Not sure exactly what designation is if it should go in the User or the Role. If it is specific to the relationship or if it is specific to the user.

This really works like a charm!!! thanks a ton…