Skip to content
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

Merged
merged 25 commits into from
Feb 3, 2025

Conversation

461OceanBd
Copy link
Contributor

@461OceanBd 461OceanBd commented Jan 15, 2025

Script Node permettant d'intégrer des fichiers scdl par batch avec gestion d'erreur appropriées.
Nb :

  • Des variables d'environnement sont a ajouter à la preprod et à la prod pour parametrer le choix du path des fichiers et du json
  • Une doc et/ou un json prerempli peut être nécessaire pour se servir de ce script. Déterminer où la placer. --> doc dans les instructions pour version et json avec les jeux de données a traiter

Sorry, something went wrong.

@461OceanBd 461OceanBd self-assigned this Jan 15, 2025
@461OceanBd 461OceanBd linked an issue Jan 15, 2025 that may be closed by this pull request
@461OceanBd 461OceanBd force-pushed the 3121-scdl-integration-script branch 5 times, most recently from 5242912 to f7f7fae Compare January 16, 2025 12:00

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- added types for parseParams
- corrected type error
@461OceanBd 461OceanBd force-pushed the 3121-scdl-integration-script branch from 18996b5 to 208be39 Compare January 16, 2025 15:25
@461OceanBd 461OceanBd marked this pull request as ready for review January 16, 2025 15:36
- rename variable
- type factorization
- explicited describe name
- mocked fs
- refacto to test on thing in each test
- renamed var
Copy link
Collaborator

@alice-telescoop alice-telescoop left a 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

Comment on lines -35 to +40
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);
Copy link
Collaborator

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 ?

Copy link
Contributor Author

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

- refacto: change parseParams type, object instead of array
@461OceanBd 461OceanBd force-pushed the 3121-scdl-integration-script branch from 0d3221d to cf533e0 Compare January 29, 2025 12:58
- changed console.trace
- del redundant test
- renamed libel
- refacto to use code with cli
# Conflicts:
#	packages/api/src/cli.ts
@alice-telescoop alice-telescoop merged commit 593deb4 into develop Feb 3, 2025
7 checks passed
@alice-telescoop alice-telescoop deleted the 3121-scdl-integration-script branch February 3, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Créer un script d'automatisation d'intégration des données scdl
3 participants