Skip to content

DDD, Unit of work pattern for Typescript, Nest.js, Prisma ⚡

License

Notifications You must be signed in to change notification settings

zhuravlevma/prisma-unit-of-work

Repository files navigation

Unit of work pattern for PrismaORM

return this.unitOfWork.runInTransaction(async (tx) => {
  const updatedAggregate1 = await this.repo.saveAggregate1(entity, { tx });
  await this.repo2.saveAggregate2(entity, { tx });
  return updatedAggregate1;
});

image