return this.unitOfWork.runInTransaction(async (tx) => {
const updatedAggregate1 = await this.repo.saveAggregate1(entity, { tx });
await this.repo2.saveAggregate2(entity, { tx });
return updatedAggregate1;
});
zhuravlevma/prisma-unit-of-work
DDD, Unit of work pattern for Typescript, Nest.js, Prisma ⚡
TypeScriptMIT