-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(formation): ajout extraction flux onisep (#302)
Co-authored-by: gmoizan <guillaume.moizan@octo.com>
- Loading branch information
Showing
37 changed files
with
1,047 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...s/src/extraction/application-service/extraire-flux-formations-initiales-onisep.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { FluxExtraction } from "@formations-initiales/src/extraction/domain/model/flux"; | ||
import { | ||
ExtraireFluxDomainService, | ||
} from "@formations-initiales/src/extraction/domain/service/extraire-flux.domain-service"; | ||
|
||
import { Usecase } from "@shared/src/application-service/usecase"; | ||
|
||
export class ExtraireFluxFormationsInitialesOnisep implements Usecase { | ||
constructor(private readonly extraireFlux: ExtraireFluxDomainService) { | ||
} | ||
|
||
public executer(flux: FluxExtraction): Promise<void> { | ||
return this.extraireFlux.extraire(flux); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
apps/formations-initiales/src/extraction/application-service/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Module } from "@nestjs/common"; | ||
|
||
import { | ||
ExtraireFluxFormationsInitialesOnisep, | ||
} from "@formations-initiales/src/extraction/application-service/extraire-flux-formations-initiales-onisep.usecase"; | ||
import { | ||
ExtraireFluxDomainService, | ||
} from "@formations-initiales/src/extraction/domain/service/extraire-flux.domain-service"; | ||
import { FluxRepository } from "@formations-initiales/src/extraction/domain/service/flux.repository"; | ||
import { Gateways } from "@formations-initiales/src/extraction/infrastructure/gateway"; | ||
|
||
import { Shared } from "@shared/src"; | ||
import { DateService } from "@shared/src/domain/service/date.service"; | ||
|
||
@Module({ | ||
imports: [Gateways, Shared], | ||
providers: [{ | ||
provide: ExtraireFluxDomainService, | ||
inject: ["FluxRepository", DateService], | ||
useFactory: (fluxRepository: FluxRepository, dateService: DateService): ExtraireFluxDomainService => { | ||
return new ExtraireFluxDomainService(fluxRepository, dateService); | ||
}, | ||
}, { | ||
provide: ExtraireFluxFormationsInitialesOnisep, | ||
inject: [ExtraireFluxDomainService], | ||
useFactory: (extraireFluxDomainService: ExtraireFluxDomainService): ExtraireFluxFormationsInitialesOnisep => { | ||
return new ExtraireFluxFormationsInitialesOnisep(extraireFluxDomainService); | ||
}, | ||
}], | ||
exports: [ExtraireFluxFormationsInitialesOnisep], | ||
}) | ||
export class Usecases { | ||
} |
14 changes: 14 additions & 0 deletions
14
apps/formations-initiales/src/extraction/domain/model/flux.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Flux } from "@shared/src/domain/model/flux"; | ||
|
||
export class FluxExtraction extends Flux { | ||
constructor( | ||
nomDuFlux: string, | ||
extension: string, | ||
public readonly dossierHistorisation: string, | ||
public readonly url: string | ||
) { | ||
super(nomDuFlux, extension); | ||
this.dossierHistorisation = dossierHistorisation; | ||
this.url = url; | ||
} | ||
} |
Oops, something went wrong.