loopback-next
loopback-next copied to clipboard
[LB-Next] Support of Relation (BelongsTo & hasMany) for Repository and ModelDefinition
Details
Details can be found in #419.
For example, `Customer` and `Order` has the `belongsTo` relation. When customerId was given,
it becomes the filter for the `Order` repository. It implies that `Order` repository is not a free
form repository but is constrained by `customerID=xxx`.
When doing CRUD operation, make sure this constrained is honored.
Currently, we are using primary key/foreign key for the relationship.
In LB Next, we should allow people to use any properties.
This task is only for belongsTo relation.
Acceptance Criteria
- [ ] Actual implementation on
belongsToandhasMany - [ ] Have example in how to use it
- [ ] have test cases
BLOCKED BY
- https://github.com/strongloop/loopback-next/issues/537
I've created a new issue #812 and just realised it's duplicated.
Closing it in favor of https://github.com/strongloop/loopback-next/issues/995