Skip to content

Commit

Permalink
feat(stages): fix nom employeur et identifiant source et cp
Browse files Browse the repository at this point in the history
  • Loading branch information
juliebrunetto83 committed Oct 3, 2023
1 parent 30e4c88 commit ee4087c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 4 additions & 0 deletions apps/cli/src/command/transform.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
TransformFlowStudapartSubCommand,
} from "@logements/src/transformation/infrastructure/sub-command/transform-flow-studapart.sub-command";

import {
TransformFlowHelloworkSubCommand,
} from "@stages/src/transformation/infrastructure/sub-command/transform-flow-hellowork.sub-command";
import {
TransformFlowJobteaserSubCommand,
} from "@stages/src/transformation/infrastructure/sub-command/transform-flow-jobteaser.sub-command";
Expand All @@ -31,6 +34,7 @@ import {
TransformFlowTousMobilisesSubCommand,
TransformFlowImmojeuneSubCommand,
TransformFlowStudapartSubCommand,
TransformFlowHelloworkSubCommand,
TransformFlowJobteaserSubCommand,
TransformFlowStagefrCompressedSubCommand,
TransformFlowStagefrUncompressedSubCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ export namespace Hellowork {
export import Domaine = _Domaine

export type OffreDeStage = {
id: string;
id: number;
reference?: string
// TODO (BRUJ 29-09-2023): format de la date
date: string
title: string
link: string
compagny: string
company: string
logo?: string
publisher?: string
city?: string
postalcode?: string
postalcode?: number
inseecode?: string
country?: string
geoloc?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,15 @@ export class Convertir {
const maintenant = this.dateService.maintenant().toISOString();

return {
// TODO (BRUJ 29-09-2023): changer dateDeDebutMax/Min
dateDeDebutMax: undefined,
dateDeDebutMin: undefined,
description: offreDeStage.description,
domaines: [{ nom: this.traduireDomaine(offreDeStage.seodomain) }],
employeur: {
nom: offreDeStage.compagny,
nom: offreDeStage.company,
logoUrl: offreDeStage.logo,
},
identifiantSource: offreDeStage.id,
identifiantSource: offreDeStage.id.toString(),
localisation: this.recupererLaLocalisation(offreDeStage),
// TODO (BRUJ 29-09-2023): rajouter la rémunération en string
source: UnJeune1Solution.Source.HELLOWORK,
Expand All @@ -108,7 +107,7 @@ export class Convertir {
private recupererLaLocalisation(offreDeStage: Hellowork.OffreDeStage): UnJeune1Solution.Localisation {
return {
ville: offreDeStage.city,
codePostal: offreDeStage.postalcode,
codePostal: offreDeStage.postalcode.toString(),
pays: this.pays.versFormatISOAlpha2(offreDeStage.country),
latitude: offreDeStage.geoloc && Number(offreDeStage.geoloc.split(",")[0]),
longitude: offreDeStage.geoloc && Number(offreDeStage.geoloc?.split(",")[1]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("TransformerFluxHelloworkTest", () => {
logoUrl: "http://url.du.logo",
},
domaines: [{ nom: UnJeune1Solution.Domaine.LOGISTIQUE }],
identifiantSource: "Identifiant source",
identifiantSource: "15788",
localisation: {
ville: "Marseille",
codePostal: "13000",
Expand Down Expand Up @@ -83,15 +83,15 @@ describe("TransformerFluxHelloworkTest", () => {
job: [OffreDeStageHelloworkFixtureBuilder.build({
title: "Titre de l'offre",
description: "Description de l'offre",
compagny: "Nom de l'entreprise",
company: "Nom de l'entreprise",
logo: "http://url.du.logo",
seodomain: Hellowork.Domaine.LOGISTIQUE,
date: "2022-01-01T00:00:00.000Z",
city: "Marseille",
postalcode: "13000",

Check failure on line 91 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Mutation

Type 'string' is not assignable to type 'number'.

Check failure on line 91 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Mutation

Type 'string' is not assignable to type 'number'.

Check failure on line 91 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Mutation

Type 'string' is not assignable to type 'number'.

Check failure on line 91 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Test

Type 'string' is not assignable to type 'number'.
country: "France",
link: "https://url-de-candidature.com",
id: "Identifiant source",
id: 15788,
geoloc: "15.5,16.78",
})],
},
Expand All @@ -114,6 +114,7 @@ describe("TransformerFluxHelloworkTest", () => {
dateDeDebutMin: undefined,
dateDeDebutMax: undefined,
source: Source.HELLOWORK,
identifiantSource: "15788",
localisation: {
ville: "Marseille",
codePostal: "13000",
Expand Down Expand Up @@ -149,6 +150,7 @@ describe("TransformerFluxHelloworkTest", () => {
city: "Marseille",
postalcode: "13000",

Check failure on line 151 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Mutation

Type 'string' is not assignable to type 'number'.

Check failure on line 151 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Mutation

Type 'string' is not assignable to type 'number'.

Check failure on line 151 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Mutation

Type 'string' is not assignable to type 'number'.

Check failure on line 151 in apps/stages/test/transformation/application-service/transformer-flux-hellowork.usecase.test.ts

View workflow job for this annotation

GitHub Actions / Test

Type 'string' is not assignable to type 'number'.
country: "France",
id: 15788,
});
delete offreHellowork.geoloc;

Expand Down Expand Up @@ -176,6 +178,7 @@ describe("TransformerFluxHelloworkTest", () => {
dateDeDebutMax: undefined,
source: Source.HELLOWORK,
domaines: [{ nom: UnJeune1Solution.Domaine.NON_APPLICABLE }],
identifiantSource: "15788",
}, {
latitude: undefined,
longitude: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export class OffreDeStageHelloworkFixtureBuilder {
return {
title: "Titre de l'offre",
description: "Description de l'offre",
compagny: "Nom de l'entreprise",
company: "Nom de l'entreprise",
logo: "http://url.du.logo",
seodomain: Hellowork.Domaine.NULL,
date: "2022-01-01T00:00:00.000Z",
city: "Montpellier",
postalcode: "34",
country: "France",
link: "http://url.de.candidature.com",
id: "Identifiant source",
id: 15788,
geoloc: "15.5,16.78",
salary: "1000-2000 EUR par mois",
...offreDeStage,
Expand Down

0 comments on commit ee4087c

Please sign in to comment.