| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { Inject } from '@nestjs/common'; |
||
| 15 | |||
| 16 | public async handle({ schoolId }: SchoolCreatedEvent): Promise<void> { |
||
| 17 | const products = await this.productRepository.findProductsToImport(); |
||
| 18 | |||
| 19 | for (const product of products) { |
||
| 20 | await this.commandBus.execute( |
||
| 21 | new CreateSchoolProductCommand( |
||
| 22 | product.getUnitPrice(), |
||
| 23 | product.getUnitPrice(), |
||
| 24 | schoolId, |
||
| 25 | product.getId() |
||
| 26 | ) |
||
| 31 |