Domain model with a clean architecture with ports and adapters. It takes into account some tactical patterns from DDD.
return this.uow.runInTransaction(async (tx) => {
const updatedWh = await this.saveWh.saveWarehouse(warehouse, tx);
await this.saveReport.save(report, tx);
return updatedWh;
});
If you have a large monolith that contains many bounded contexts, then the service can be divided into modules by context.
If you have a micro service architecture and you prefer to allocate contexts to different services (which is preferable), then the service can be divided into modules by aggregates.
In this example, there are more than one bounded contexts, you have a monolith in front of you. And this monolith is internally divided into modules according to bounded contexts.
npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# arch tests
$ npm run test:arch
# test coverage
$ npm run test:cov