Nestjs, Transactions, Dependency Injection, Repository Pattern, Repository Design Pattern.
getOrders() { return await this.ordersRepository.getOrders(); } async createOrder(items: CreateItemDto[]) { const orderNo = `ORD_${randomUUID()}`; const order = await this.ordersRepository.createOrder(orderNo); await this.itemsService.createItems(order.id, items); return order; } } The getOrders