platform icon indicating copy to clipboard operation
platform copied to clipboard

refactor: improve response & error handling for ledger service

Open nishad-ayanworks opened this issue 1 year ago • 0 comments
trafficstars

  • API routes should be self-explanatory & aligned with functionality.
  • Change Promise<object> to an interface.
  • Refactor responses (Only necessary fields should populate in response).
  • Check status codes
  • Check role wise authentication to APIs with RoleGuards
  • Check API status and statusCode should be checked properly.
  • Error logs should be there where ever necessary.
  • End-to-end testing.
  • Validation on Payload.
  1. Apply trim() on payload.
  2. Apply toString(), toNumber() datatypes properly to payloads.
  3. Apply toOptional() if parameters are optionals.
  4. Apply notNull for parameters of payloads if not optional.
  • Error Response.

ex:

{
  "message": "User friendly message",
  "error": "Some error description/error stack",
  "statusCode": 400,
}

Schema APIs

  • [x] Get schema details by schema Id
  • [x] Get all schemas of platform

Cred Def APIs

  • [x] Create credential definition
  • [x] Get all credential-definitions from orgId
  • [x] Get all credential-definitions for bulk operation
  • [x] Get all credential-definitions by schema id.
  • [x] Get credential-definition details by id

nishad-ayanworks avatar Jan 02 '24 05:01 nishad-ayanworks