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): 40 implement referentiel import functionality with region academique, academie and departement support #4683

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

philippearnaud
Copy link
Collaborator

  • Added ReferentielModule to handle import tasks related to regions academiques.
  • Introduced ReferentielImportTaskService for managing import logic.
  • Created RegionAcademiqueImportService for handling region-specific imports.
  • Implemented ImportReferentielController to manage API endpoints for imports.
  • Added necessary models, DTOs, and MongoDB repository for region academique.
  • Added tests for the new functionality.

This commit enhances the APIv2 with the ability to import region academique data, improving data management capabilities.

https://www.notion.so/jeveuxaider/Importer-les-nomenclatures-SI-SNU-12272a322d508095a937c7713fb4604d?pvs=4

@philippearnaud philippearnaud changed the title feat(apiv2):40 implement referentiel import functionality with region academique support feat (apiv2) :40 implement referentiel import functionality with region academique support Jan 22, 2025
@philippearnaud philippearnaud changed the title feat (apiv2) :40 implement referentiel import functionality with region academique support feat(apiv2) :40 implement referentiel import functionality with region academique support Jan 22, 2025
@philippearnaud philippearnaud changed the title feat(apiv2) :40 implement referentiel import functionality with region academique support feat(apiv2) : 40 implement referentiel import functionality with region academique support Jan 22, 2025
@philippearnaud philippearnaud changed the title feat(apiv2) : 40 implement referentiel import functionality with region academique support feat(api): 40 implement referentiel import functionality with region academique support Jan 22, 2025
@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch 5 times, most recently from 2fef523 to 132f4d9 Compare January 24, 2025 14:11
@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch 4 times, most recently from 2c4ec5a to 697c9bf Compare January 29, 2025 13:08
@philippearnaud
Copy link
Collaborator Author

En plus du conflit, je vois un problème avec l'intégration du code de Johann sur l'import / désistement des classes et le mien. Je le règle.

@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch from 697c9bf to c515010 Compare January 31, 2025 09:59
@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch from c515010 to a170ff7 Compare January 31, 2025 14:20
@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch from a170ff7 to bb0c637 Compare January 31, 2025 14:24
}).compile();


regionAcademiqueGateway = module.get<RegionAcademiqueGateway>(RegionAcademiqueGateway);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense qu'on peut éviter toutes les références à Mongoose dans les tests, il y a un intérêt à découpler les tests aussi.
Que penses tu d'un helper : apiv2/test/admin/sejour/cle/EtablissementHelper.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui, bonne idée

throw new RegionAcademiqueValidationError('Invalid format - zone');
}

if (!regionAcademique.dateDerniereModificationSI || !isValidDate(regionAcademique.dateDerniereModificationSI)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sur la v2 il y a clockGateway : apiv2/src/shared/core/Clock.gateway.ts implémenté par ClockProvider qui dépend de date-fns
ça permet de repartir sur qqch de plus propre dans la gestion des dates

@philippearnaud philippearnaud changed the title feat(api): 40 implement referentiel import functionality with region academique support feat(api): 40 implement referentiel import functionality with region academique, academie and departement support Jan 31, 2025
@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch from 1e019be to 390e537 Compare February 4, 2025 09:22
Philippe de Mangou and others added 10 commits February 4, 2025 17:17
… academique support

- Added ReferentielModule to handle import tasks related to regions academiques.
- Introduced ReferentielImportTaskService for managing import logic.
- Created RegionAcademiqueImportService for handling region-specific imports.
- Implemented ImportReferentielController to manage API endpoints for imports.
- Added necessary models, DTOs, and MongoDB repository for region academique.
- Added tests for the new functionality.

This commit enhances the API with the ability to import region academique data, improving data management capabilities.

Add error reporting for RegionAcademique, handling validations for classes, and add some tests and fix some typos issues
- Renamed XslX types to XlsX across multiple files
- Moved FileValidation interface to a common Referentiel module
- Updated type references in mapper, model, and service files
- Ensured consistent naming for Excel file-related types
- Moved column names and file validation logic to specific model files
- Updated import task service to use ClockGateway for timestamp generation
- Added todo list for future referentiel import improvements
- Cleaned up imports and type references across referentiel modules
- Prepared groundwork for additional referentiel import types
- Integrated Département referentiel import support
- Updated ReferentielModule to include Département-related providers and services
- Added Département import task type to ReferentielTaskType
- Implemented import handling for Département in AdminTaskImportReferentielSelectorService
- Updated test cases to support Département import
- Marked Département referentiel task as completed in todo list
- Integrated Academie referentiel import support
- Updated ReferentielModule to include Academie-related providers and services
- Added Academie import task type to ReferentielTaskType
- Implemented import handling for Academie in AdminTaskImportReferentielSelectorService
- Removed deprecated DTO classes and replaced with Mapper pattern
- Updated todo list to mark Academie referentiel import as completed
- Deleted unnecessary pre-save middleware for Academie, Departement, and RegionAcademique schemas
- Removed TODO comments related to user and timestamp tracking
- Simplified MongoDB provider configurations for referentiel entities
- Replaced enum with object-based FilePath configuration
- Updated file upload paths to use dynamic FilePath mapping
- Standardized file path generation for different referentiel import types
- Simplified file path management across referentiel services
… across referentiel modules

- Replaced direct date validation with ClockGateway's isValidDate method
- Renamed Mapper classes to ImportMapper for consistent naming
- Updated import use cases to use ClockGateway for date validation
- Removed deprecated isValidDate function from snu-lib
- Simplified date parsing and validation logic across Academie, Departement, and RegionAcademique imports
…epositories

- Implemented deleteAll() method in AcademieGateway, DepartementGateway, and RegionAcademiqueGateway
- Added corresponding deleteAll() implementations in MongoDB repositories
- Created helper functions for deleting all entities in test helpers
- Updated test cases to use new deleteAll() method for test data cleanup
- Standardized data deletion approach across referentiel modules
…ement, and RegionAcademique repositories

- Implemented detailed test cases for AcademieMongoRepository
- Added comprehensive test coverage for DepartementMongoRepository
- Updated RegionAcademiqueMongo.repository.spec.ts with improved test structure
- Introduced helper methods for creating and deleting test data
- Ensured consistent testing approach across referentiel repositories
@philippearnaud philippearnaud force-pushed the feat-3620-import-cibles-dpt-reg branch from 390e537 to 445e712 Compare February 4, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants