Repository navigation
Conversation
…name of a DTO The documentation of the handler sending the file of an attachment described the search of the attachments of a log, and both handlers documented a `undefined` result whereas they resolve once the response is sent. `GetAttachmentDto.js` exported a schema named `GetLogAttachmentDto`.
…s without file - `GET /api/attachments/:attachmentId` answered with the status 400 when the attachment does not exist, whereas the body of the error says 404: it now answers 404 - `POST /api/attachments` accepted a multipart request without any file (the file middleware gives an empty list, which passed the validation) and crashed with a `TypeError`, ending as a generic server error: it is now rejected with a 400 (`files` must contain at least one file) API tests check the two cases, an invalid log id and an invalid attachment id.
…logs Nothing uses the creation and update dates of an attachment: the frontend only reads its id, file name, original name, mime type and size, and no test checks them. `AttachmentAdapter.toEntity` is only used for the `attachments` of the logs, which therefore lose the two fields, and the `Attachment` typedef is updated. The response of `POST /api/attachments` is not affected: it is the row of the database as it is.
…ed HTTP API documentation The generator only knew JSON request bodies, so the `curl` example of an endpoint receiving files had no file, and the one of an endpoint returning a file printed it in the terminal. A `multipart/form-data` body is now rendered like a JSON one, with a `-F field=value` option per field of its example (a file being `@path`), and the `curl` example of an operation whose successful response is not JSON saves the file with the name given by the server (`-OJ`). The documentation of the endpoints already documented is unchanged.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/O2B-1623/docs-eos-report-endpoint #2281 +/- ##
=============================================================================
- Coverage 46.65% 42.53% -4.12%
=============================================================================
Files 1063 1064 +1
Lines 17439 17453 +14
Branches 3176 3178 +2
=============================================================================
- Hits 8136 7424 -712
- Misses 9303 10029 +726 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
graduta
added this pull request to stack #2276
October 22, 2026 14:02
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tion Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… service migration Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have a JIRA ticket
Part of a stack of PRs documenting the HTTP API (O2B-1623). This PR is stacked on the previous one of the stack (its base is the branch of that PR): GitHub retargets it to
mainonce the PRs below are merged.Notable changes for users:
POST /api/attachmentsandGET /api/attachments/{attachmentId}endpoints are now documented at/api-docs(thePOSTis flaggedx-llm-exclude). The documentation of the generator now supportsmultipart/form-databodies and file downloads, so thecurlexamples contain the-Ffields and-OJ.GET /api/attachments/{attachmentId}now answers with the status404(it answered400with a body saying404) when the attachment does not exist.POST /api/attachmentsnow rejects (400) a request without any file instead of crashing with a generic server error.attachmentsof a log no longer containcreatedAtandupdatedAt(nothing used them; breaking for any external client reading them). The response ofPOST /api/attachmentsis the row of the database as it is and is not affected.Notable changes for developers:
AttachmentService(getOneOrFail,create) on small functions;lib/usecases/attachmentis removed.title: Not foundand adetail), and the creation response no longer containscreatedAtandupdatedAt.lib/usecases/attachment:CreateAttachmentUseCase,GetAttachmentUseCase, plusGetAllLogAttachmentsUseCaseandGetLogAttachmentUseCasefor the logs endpoints). They are not migrated here: to be decided with the team (small: two use cases for this router, the two others belong to the logs router).TypeErrorfor an upload without file (the file middleware gives an empty list, which passed thexor('file', 'files')check:filesmust now contain at least one file).AttachmentAdapter.toEntity(only used for the attachments of logs) no longer returnscreatedAt/updatedAt, and theAttachmenttypedef is updated.GetAttachmentDto.jsexportedGetLogAttachmentDto).POST /api/attachmentsreturns the raw row (with the path of the file on the server and ISO dates) instead of the entity, only the first file of a request is stored (the others are written on the server and never referenced) andlogis optional.Changes made to the database:
🤖 Generated with Claude Code