Add tests and refactor worker service models and error handling #189

Merged
rwachters merged 3 commits from refactor(worker)-separate-entity-and-dto-models into change-mcp-tool-call-architecture 2026-04-10 21:28:16 +00:00
rwachters commented 2026-04-10 21:26:31 +00:00 (Migrated from github.com)

Description

This pull request implements the following changes:

  • Testing:
    Added comprehensive tests for service token challenge issuance, including scenarios for mismatched worker IDs, invalid signatures, and successful service token exchanges.

  • Refactoring:

    • Improved error handling for unique constraint violations by replacing string-based checks with a new isUniqueConstraintViolation() utility.
    • Separated worker data models into WorkerEntity for internal use and WorkerDto for public API responses.
    • Updated relevant DAOs, services, and API components to use the correct model representation, ensuring sensitive data like certificates are excluded from public responses.
    • Introduced mapping functions for seamless conversions between the new data models.

Checklist

  • Tests have been added/updated
  • Documentation has been updated (if applicable)
  • New code follows established project conventions
### Description This pull request implements the following changes: - **Testing:** Added comprehensive tests for service token challenge issuance, including scenarios for mismatched worker IDs, invalid signatures, and successful service token exchanges. - **Refactoring:** - Improved error handling for unique constraint violations by replacing string-based checks with a new `isUniqueConstraintViolation()` utility. - Separated worker data models into `WorkerEntity` for internal use and `WorkerDto` for public API responses. - Updated relevant DAOs, services, and API components to use the correct model representation, ensuring sensitive data like certificates are excluded from public responses. - Introduced mapping functions for seamless conversions between the new data models. ### Checklist - [ ] Tests have been added/updated - [ ] Documentation has been updated (if applicable) - [ ] New code follows established project conventions
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Torvian.eu/chatbot!189
No description provided.