✅ Purpose

Defines a master → employee relationship for access control in Admin.

🧩 Fields

  • master — FK to User
  • employee — FK to User

Constraint: (master, employee) is unique.

🧠 Methods

  • get_employees(user, with_master=False)

    • returns employee list for a master
    • optionally includes the master
  • get_master(user)

    • returns master for the given employee or None