joshuaalpuerto / node-ddd-boilerplate

Node DDD Boilerplate

Home Page:https://joshuaalpuerto.github.io/node-ddd-boilerplate/#/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: What is correct way to provide repositories?

bfunc opened this issue · comments

Here
src\interfaces\http\modules\user\instance.js
We have this code:

const container = require('src/container') // we have to get the DI
const { get, post, put, remove } = require('src/app/user')

module.exports = () => {
  const { repository: { userRepository}} = container.cradle

  const postUseCase = post({ userRepository, ??? })

Question, if in my case to store User there is need to update several repositiries, I should add it here, but why? Is this responsibility of external Interface to know what repositories are needed to store entity?