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
| Relation Type | Explanation |
|---|---|
belongsTo | A Member belongs to one Team |
hasMany | A Team has many Members |
hasOne | A Member has one Profile |
belongsToMany | A Member can belong to many Projects and vice versa |
