From 749e44da43ddcd5b3141046d4f8c3dac5230e5a0 Mon Sep 17 00:00:00 2001 From: "Claude Sonnet 5.5" Date: Thu, 22 Oct 2026 10:52:01 +0200 Subject: [PATCH 1/3] [O2B-1623] Do not send createdAt and updatedAt of detectors `GET /api/detectors` sent the creation and update dates of each detector, which nothing uses: the GUI only reads the type and the name through `detectorsProvider` and the dates are not part of any other consumer of `DetectorAdapter.toEntity`. The adapter now only returns `id`, `name` and `type`, the `Detector` typedef is updated accordingly (and gets its missing `id`), and the API test checks the keys of the returned detectors. --- lib/database/adapters/DetectorAdapter.js | 4 +--- lib/domain/entities/Detector.js | 3 +-- test/api/detectors.test.js | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/database/adapters/DetectorAdapter.js b/lib/database/adapters/DetectorAdapter.js index e7854bb267..b3d5cfbd2b 100644 --- a/lib/database/adapters/DetectorAdapter.js +++ b/lib/database/adapters/DetectorAdapter.js @@ -30,13 +30,11 @@ class DetectorAdapter { * @param {SequelizeDetector} databaseObject Object to convert. * @returns {Detector} Converted entity object. */ - toEntity({ id, name, type, createdAt, updatedAt }) { + toEntity({ id, name, type }) { return { id, name, type, - createdAt: new Date(createdAt).getTime(), - updatedAt: new Date(updatedAt).getTime(), }; } diff --git a/lib/domain/entities/Detector.js b/lib/domain/entities/Detector.js index 2643838311..7ccb4bfc98 100644 --- a/lib/domain/entities/Detector.js +++ b/lib/domain/entities/Detector.js @@ -14,8 +14,7 @@ /** * @typedef Detector * + * @property {number} id * @property {string} name * @property {'PHYSICAL'|'QC'|'VIRTUAL'|'OTHER'} type - * @property {number} createdAt - * @property {number} updatedAt */ diff --git a/test/api/detectors.test.js b/test/api/detectors.test.js index e391121cb4..fe8a656d90 100644 --- a/test/api/detectors.test.js +++ b/test/api/detectors.test.js @@ -25,6 +25,7 @@ module.exports = () => { expect(response.status).to.equal(200); expect(response.body).to.be.an('object'); + response.body.data.forEach((detector) => expect(Object.keys(detector)).to.have.members(['id', 'name', 'type'])); expect(response.body.data.map(({ id, name }) => ({ id, name }))).to.deep.eq([ { id: 17, name: 'ACO' }, { id: 1, name: 'CPV' }, From 97ffa8e67431b81f6578d36a8129aac7412c98f5 Mon Sep 17 00:00:00 2001 From: "Claude Sonnet 5.5" Date: Tue, 20 Oct 2026 14:54:43 +0200 Subject: [PATCH 2/3] [O2B-1623] Document the detectors endpoint in the HTTP API specification --- lib/server/api-docs/openapi.yaml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/server/api-docs/openapi.yaml b/lib/server/api-docs/openapi.yaml index ebaa4bc8cd..58605ae0b4 100644 --- a/lib/server/api-docs/openapi.yaml +++ b/lib/server/api-docs/openapi.yaml @@ -41,6 +41,8 @@ tags: description: Health of the Bookkeeping application and of its database. - name: Configuration description: Addresses of the external services Bookkeeping links to. + - name: Detectors + description: Detectors of the ALICE experiment. paths: /tags: @@ -291,6 +293,23 @@ paths: QcGuiUrl: http://localhost:8082 AliEcsGuiUrl: http://localhost:8080 + /detectors: + get: + tags: [Detectors] + operationId: listDetectors + summary: List all detectors + description: Returns every detector, sorted alphabetically by name. Not paginated. + responses: + '200': + description: The detectors. + content: + application/json: + schema: { $ref: '#/components/schemas/DetectorListResponse' } + example: + data: + - { id: 17, name: ACO, type: PHYSICAL } + - { id: 21, name: GLO, type: QC } + components: securitySchemes: jwtQuery: @@ -436,3 +455,20 @@ components: AliFlpIndexUrl: { type: [string, 'null'], description: ali-flp-index page. } QcGuiUrl: { type: [string, 'null'], description: Quality Control GUI. } AliEcsGuiUrl: { type: [string, 'null'], description: AliECS GUI. } + Detector: + type: object + required: [id, name, type] + properties: + id: { type: integer } + name: { type: string, description: 'Detector code, e.g. `ITS`.' } + type: + type: string + enum: [PHYSICAL, QC, AOT-GLO, AOT-EVENT, MUON-GLO, VIRTUAL, OTHER] + description: Kind of detector. Only `PHYSICAL` and `VIRTUAL` detectors can take part in data taking. + DetectorListResponse: + type: object + required: [data] + properties: + data: + type: array + items: { $ref: '#/components/schemas/Detector' } From a545ba4fdd0f258d2cdb1a681a035b8dd35a5c55 Mon Sep 17 00:00:00 2001 From: "Claude Sonnet 5.5" Date: Thu, 22 Oct 2026 10:52:08 +0200 Subject: [PATCH 3/3] [O2B-1623] Regenerate the HTTP API documentation with the detectors endpoint --- lib/server/api-docs/API.md | 18 ++++++++++++++++++ lib/server/api-docs/index.html | 14 ++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/lib/server/api-docs/API.md b/lib/server/api-docs/API.md index 988eb990f7..3d61711ca7 100644 --- a/lib/server/api-docs/API.md +++ b/lib/server/api-docs/API.md @@ -269,3 +269,21 @@ Responses: ```bash curl -g "$BOOKKEEPING_URL/api/configuration?token=$TOKEN" ``` + +## Detectors + +Detectors of the ALICE experiment. + +### `GET /detectors` - List all detectors + +Operation id: `listDetectors` + +Returns every detector, sorted alphabetically by name. Not paginated. + +Responses: + +- `200`: The detectors. + +```bash +curl -g "$BOOKKEEPING_URL/api/detectors?token=$TOKEN" +``` diff --git a/lib/server/api-docs/index.html b/lib/server/api-docs/index.html index 4b8861d795..f1bdc02e32 100644 --- a/lib/server/api-docs/index.html +++ b/lib/server/api-docs/index.html @@ -474,6 +474,20 @@

Configuration

curl -g "$BOOKKEEPING_URL/api/configuration?token=$TOKEN"
 
+

Detectors

+

Detectors of the ALICE experiment.

+
+

GET /detectors - List all detectors

+ +

Operation id: listDetectors

+

Returns every detector, sorted alphabetically by name. Not paginated.

+

Responses:

+
    +
  • 200: The detectors.
  • +
+
curl -g "$BOOKKEEPING_URL/api/detectors?token=$TOKEN"
+
+