-
Notifications
You must be signed in to change notification settings - Fork 87
starting update thesaurus use case #8700
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
base: production
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR implements the Update Thesaurus use case, which allows updating thesaurus entities including their names and values. The implementation includes domain logic for computing differences between thesaurus versions, updating translations accordingly, and managing background jobs for entity denormalization.
Key changes:
- Added
Thesaurus.update()method andThesaurusDiffclass for computing changes between thesaurus versions - Implemented
UpdateThesaurusUseCasewith transaction support and job management - Extended queue system with
deleteByParams()functionality to manage background jobs - Added comprehensive test coverage for domain logic, services, and integration scenarios
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| app/setUpJestServer.js | Added polyfill for structuredClone for Node versions < 17 |
| app/api/i18n.v2/database/MongoTranslationsDataSource.ts | Added updateKeysByContextV2 method for bulk translation key updates |
| app/api/i18n.v2/contracts/TranslationsDataSource.ts | Added UpdateKeysByContextProps type and interface method |
| app/api/core/libs/queue/infrastructure/*.ts | Implemented deleteByParams across queue adapters and dispatchers |
| app/api/core/infrastructure/mongodb/thesauri/MongoThesaurusDataSourceV2.ts | Added update and geyById methods (note: typo in method name) |
| app/api/core/infrastructure/jobs/DenormalizeThesaurusEntitiesHandler.ts | Created job handler for denormalizing thesaurus entities |
| app/api/core/domain/thesaurus/Thesaurus.ts | Implemented update method and getValueById helper |
| app/api/core/domain/thesaurus/ThesaurusDiff.ts | Created class to compute differences between thesaurus versions |
| app/api/core/domain/thesaurus/errors.ts | Added InvalidThesaurusValueIdsError validation error |
| app/api/core/application/thesaurusTranslationService/ThesaurusTranslationService.ts | Added update method to handle translation updates |
| app/api/core/application/UpdateThesaurus.ts | Implemented the main use case with transaction support |
| app/api/core/application/contracts/ThesauriDataSource.ts | Extended interface with geyById and update methods (note: typo) |
| app/api/common.v2/utils/Test.ts | Added arrayIncludesObjects test helper |
| Various test files | Comprehensive test coverage for new functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/api/core/infrastructure/mongodb/thesauri/MongoThesaurusDataSourceV2.ts
Outdated
Show resolved
Hide resolved
app/api/core/application/thesaurusTranslationService/specs/ThesaurusTranslationService.spec.ts
Outdated
Show resolved
Hide resolved
app/api/core/libs/queue/application/contracts/JobsDispatcher.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…aSourceV2.ts Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…saurusTranslationService.spec.ts Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
fixes #8694
PR checklist:
QA checklist: