File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { Module } from '@nestjs/common' ;
2
2
import { splitDb2 } from '~/core' ;
3
+ import { ProductModule } from '../../product/product.module' ;
3
4
import { PnpExtractionResultProgressReportConnectionResolver } from './pnp-extraction-result-progress-report-connection.resolver' ;
4
5
import { PnpExtractionResultRepository } from './pnp-extraction-result.edgedb.repository' ;
5
6
import { PnpExtractionResultLoader } from './pnp-extraction-result.loader' ;
6
7
import { PnpExtractionResultNeo4jRepository } from './pnp-extraction-result.neo4j.repository' ;
7
8
import { SaveProgressExtractionResultHandler } from './save-progress-extraction-result.handler' ;
8
9
9
10
@Module ( {
11
+ imports : [ ProductModule ] ,
10
12
providers : [
11
13
PnpExtractionResultProgressReportConnectionResolver ,
12
14
PnpExtractionResultLoader ,
Original file line number Diff line number Diff line change 1
1
import { EventsHandler } from '~/core' ;
2
2
import { PeriodicReportUploadedEvent } from '../../periodic-report/events' ;
3
+ import { ProductStep } from '../../product/dto' ;
4
+ import { PnpProductSyncService } from '../../product/pnp-product-sync.service' ;
3
5
import { PnpExtractionResultRepository } from './pnp-extraction-result.edgedb.repository' ;
4
6
5
7
@EventsHandler ( [ PeriodicReportUploadedEvent , - 1 ] )
6
8
export class SaveProgressExtractionResultHandler {
7
- constructor ( private readonly repo : PnpExtractionResultRepository ) { }
9
+ constructor (
10
+ private readonly repo : PnpExtractionResultRepository ,
11
+ private readonly productSyncer : PnpProductSyncService ,
12
+ ) { }
8
13
9
14
async handle ( event : PeriodicReportUploadedEvent ) {
10
15
if ( ! event . pnpResultUsed ) {
11
16
return ;
12
17
}
13
18
19
+ // Parse product/goal sync to hydrate problems from that process.
20
+ await this . productSyncer . parse ( {
21
+ engagementId : event . report . parent . properties . id ,
22
+ // Roll with all the steps to get something since we don't have the actual
23
+ // methodology from the user to filter with
24
+ availableSteps : [ ...ProductStep ] ,
25
+ pnp : event . file ,
26
+ result : event . pnpResult ,
27
+ } ) ;
28
+
14
29
await this . repo . save ( event . file . id , event . pnpResult ) ;
15
30
}
16
31
}
You can’t perform that action at this time.
0 commit comments