herbsjs / herbs2knex

Create repositories using Knex to retrieve and store Entities
Other
7 stars 13 forks source link

feat(repository): adds support to identify entity ids automatically #40

Closed euduardo closed 2 years ago

euduardo commented 2 years ago

added support to identify entity ids automatically

fix #35

Update buchu package version, so now it uses the new id custom field to automatically identify the entities ids in the repository. It solves the issue #35

Proposed Changes

  1. Created the private method getEntityIds in the Repository class. It automatically identify the ids of an entity and uses them if the user don't provide the ids option.
  2. Created the unit tests for the constructor of Repository. It ensures the fields are filled the right way.
  3. Updated the unit and integration tests to use the id custom field and the new feature, that allow omitting the ids in the repository constructor options

Readiness Checklist

Author/Contributor

Reviewing Maintainer

jhomarolo commented 2 years ago

@euduardo this pr is under conflict