Nestjs, Transactions, Dependency Injection, Repository Pattern, Repository Design Pattern.
itemsRepository: ItemsRepository) {} async createItems(orderId: number, items: CreateItemDto[]) { await this.itemsRepository.createItems(orderId, items); } } And I think it’s pretty self explanatory. It just takes order id and array of items and create them all in the items table calling