Skip to content

Conversation

rGregnanin
Copy link
Contributor

@rGregnanin rGregnanin commented Oct 10, 2025

PIN-7516

SRS

Description

Implemented GET /eservices/{eServiceId}/descriptors/{descriptorId}/(certified,verified,declared)Attributes routes in m2m gateway

Implementation

  • Finalize SRS
  • JIRA task link in PR, with link to SRS
  • API spec of the route in m2mGatewayApi.yml
  • Documentation: description fields in the spec endpoint, response, errors, params, etc.

Double-check errors

  • Check errors returned by the process API calls (messages should be meaningful, clean, in correct English, etc.)
  • Check spec errors: it should list all non-500 errors, also the ones that pass through from the process

Testing

Checklist:

  • Bruno call added to collection
  • Smoke test Bruno (attach result screenshot)
  • Supertest /api tests
  • /integration tests for the logic in the service
Screenshot 2025-10-17 alle 11 08 03 Screenshot 2025-10-17 alle 11 08 35 Screenshot 2025-10-17 alle 11 08 56

};

// eslint-disable-next-line max-params
async function retrieveEServiceDescriptorAttributes(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Implementation looks good 🚀
I think the code is clear enough to remove most of the comments. I would add comments only to explain the reason for a step that is not already straightforward with variable/function names

Copy link
Collaborator

Choose a reason for hiding this comment

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

Align also with @crasherbit since part of this implementation could be extracted into a utility function to also create the returning value of the POST calls, since they return the same object.

Copy link
Collaborator

@ecamellini ecamellini left a comment

Choose a reason for hiding this comment

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

Looks good 🚀
But there's a bug in the totalCount computation ⚠️
Plus, left some minor suggestions/quick fixes

@rGregnanin rGregnanin requested a review from ecamellini October 16, 2025 07:56
Copy link
Collaborator

@ecamellini ecamellini left a comment

Choose a reason for hiding this comment

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

Super!

Copy link
Contributor

@galales galales left a comment

Choose a reason for hiding this comment

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

minor change required, but spec LG

match(error.code)
.with(
"eserviceDescriptorNotFound",
"eserviceDescriptorAttributeNotFound",
Copy link
Contributor

Choose a reason for hiding this comment

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

if an attribute id exists in a descriptor and this attribute is not found in the registry, it is considered an internal error

Suggested change
"eserviceDescriptorAttributeNotFound",

@rGregnanin rGregnanin changed the base branch from develop to release/2.8.0 October 16, 2025 10:32
Copy link
Collaborator

@ecamellini ecamellini left a comment

Choose a reason for hiding this comment

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

Something wrong with the new base branch, since I see a lot of unrelated changes! It's because it was based on develop where more stuff was merged after the release branch was created...

Maybe the simplest thing to do is to merge develop again in release/2.8.0, it shouldn't be an issue. Otherwise, you need to re-apply only the changes related to this feature and it's not straightforward

@rGregnanin rGregnanin requested a review from ecamellini October 17, 2025 09:13
@Carminepo2 Carminepo2 force-pushed the PIN-7516_m2mGateway_getEserviceAttributes branch from 4610492 to 56dd195 Compare October 17, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants