platform
platform copied to clipboard
refactor: improve response & error handling for ledger service
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
statusandstatusCodeshould be checked properly. - Error logs should be there where ever necessary.
- End-to-end testing.
- Validation on Payload.
- Apply
trim()on payload. - Apply
toString(),toNumber()datatypes properly to payloads. - Apply
toOptional()if parameters are optionals. - Apply
notNullfor 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-definitionsfromorgId - [x] Get all
credential-definitionsfor bulk operation - [x] Get all
credential-definitionsby schema id. - [x] Get
credential-definitiondetails by id