-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): #3121 scdl integration script #3124
Conversation
5242912
to
f7f7fae
Compare
- renamed script
- added types for parseParams
- rename variable
- corrected type error
18996b5
to
208be39
Compare
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.ts
Outdated
Show resolved
Hide resolved
- rename variable
- type factorization
- explicited type
- explicited describe name
- mocked fs
- del brackets
- refacto to test on thing in each test
- renamed var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis d'accord avec Maxime c'est un joli travail
rowOffsetStr: number | string = 0, | ||
rowOffset: number | string = 0, | ||
) { | ||
await this.validateGenericInput(file, producerSlug, exportDate); | ||
const rowOffset = typeof rowOffsetStr === "number" ? rowOffsetStr : parseInt(rowOffsetStr); | ||
const parsedRowOffset = typeof rowOffset === "number" ? rowOffset : parseInt(rowOffset); | ||
const fileContent = fs.readFileSync(file); | ||
const { entities, errors } = ScdlGrantParser.parseExcel(fileContent, pageName, rowOffset); | ||
const { entities, errors } = ScdlGrantParser.parseExcel(fileContent, pageName, parsedRowOffset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ils étaient pas bien les noms de variables ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'était pour répondre à la remarque de Maxime sur le fait que c'est bizarre que la variable rowOffsetStr s'appelle comme ça alors qu'on peut aussi mettre un number
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
packages/api/src/interfaces/scripts/ScdlDataIntegration.node.test.ts
Outdated
Show resolved
Hide resolved
- refacto: change parseParams type, object instead of array
0d3221d
to
cf533e0
Compare
- changed console.trace
- del afterEach
- del redundant test
- renamed libel
- refacto to use code with cli
# Conflicts: # packages/api/src/cli.ts
Script Node permettant d'intégrer des fichiers scdl par batch avec gestion d'erreur appropriées.
Nb :