A Practical Introduction to Entity Relationships in Supista ERP
In Supista ERP, data modeling is powered by Sequelize-style relationships that define how different tables (or components) interact with each other. Understanding these relationships is essential for designing clean, scalable, and maintainable ERP modules.
In this guide, we explore the four primary relationship types using a consistent and relatable scenario: Members and Teams. These examples will help you understand not only the theory but also the practical implementation using Supista's OpWithRelation APIs.
| Relation Type | Explanation |
|---|---|
| belongsTo | A Members belongs to one team |
| hasMany | A team has many Members |
| hasOne | A Members has one profile |
| belongsToMany | A Members can belong to many projects and vice versa |