'How to realize Hierachy with multiple parents in typeorm

I am planning to store the hierachy of an organization with typeorm in nestjs. I am using a postgres database for storing that. Every User in the Organization can have multiple superiors and multiple inferiors just like this picture: example hierachy How do I realize that with TypeORM? I need to be able to determine, in my code later on, who is superior and who isnt responsible for UserX.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source