I want to make NestJS sequelize models (entities) in extra package and use it in my NESTJS microservices. My database tables has so many foreign keys and in some of my microservices my models has identically same structure. I don’t want to write models many times. Now I made package like with next structure:
sap-ecommerce-api-models/
├── dist/...
├── src/
│ ├── models/
│ │ ├── tbl_dk_users.ts
│ └── index.ts
├── package.json
├── package-lock.json
└── tsconfig.json
After finishing and importing that package to my project i got next error:
tbl_dk_users.belongsTo called with something that's not a subclass of Sequelize.Model
Where I made mistake and how can I make my models in extra package or extra project so as not to write the same models again in each project?