Skip to navigation

Registration Service Evaluation

This documents the evaluation of the Registration Service as part of the code review and assessment process. User Story 729005: SPIKE: Evaluate the Registration Service

Suggested changes and potential enhancements have been identified for each category. The items have been marked with Severity to indicate importance.


Endpoints Overview

All endpoints are documented in OpenAPI 3.0.3 format with Swagger UI at /docs.

Client Application Endpoints

MethodPathPurposeStatusDocumented
POST/v1/clientApplication/Register new client applicationImplementedYes
GET/v1/clientApplication/delivery-route/Get all delivery routesImplementedYes
GET/v1/clientApplication?clientId={id}Get apps by client IDImplementedYes
GET/v1/clientApplication/folder/{folderId}Get app by folder IDImplementedYes
GET/v1/clientApplication/application/{appId}Get app by application IDImplementedYes
PATCH/v1/clientApplication/{id}Update client applicationImplementedYes
DELETE/v1/clientApplication/{id}Delete client applicationImplementedYes

Implementation Files:

  • Routes: src/routes/v1/clientApplication.ts
  • Controller: src/controllers/clientApplicationController.ts
  • Repository: src/repositories/clientApplicationRepository.ts
  • Schemas: src/routes/v1/schemas.ts

Client Endpoints

MethodPathPurposeStatusDocumented
POST/v1/client/Register new clientImplementedYes
GET/v1/client/{clientId}Get client by IDImplementedYes
GET/v1/client/clientApplication/{clientAppId}Get client by app IDImplementedYes
PATCH/v1/client/{clientId}Update clientImplementedYes
DELETE/v1/client/{clientId}Delete clientImplementedYes

Implementation Files:

  • Routes: src/routes/v1/client.ts
  • Controller: src/controllers/clientController.ts
  • Repository: src/repositories/clientRepository.ts

File Extension Management Endpoints

MethodPathPurposeStatusDocumented
POST/v1/allowedFileExtension/Register allowed extensionImplementedYes
GET/v1/allowedFileExtension/Get all allowed extensionsImplementedYes
GET/v1/allowedFileExtension/{id}Get extension by IDImplementedYes
DELETE/v1/allowedFileExtension/{id}Delete extensionImplementedYes

Implementation Files:

  • Routes: src/routes/v1/allowedFileExtension.ts
  • Controller: src/controllers/allowedFileExtensionController.ts
  • Repository: src/repositories/allowedFileExtensionRepository.ts

Client Application Extension Mapping Endpoints

MethodPathPurposeStatusDocumented
POST/v1/clientApplication/{id}/extension/Add extensions to client appImplementedYes
GET/v1/clientApplication/{id}/extension/Get extensions for client appImplementedYes
DELETE/v1/clientApplication/{id}/extension/Remove extensions from client appImplementedYes

Implementation Files:

  • Routes: src/routes/v1/clientApplicationAllowedExtension.ts
  • Controller: src/controllers/clientApplicationAllowedExtensionController.ts
  • Repository: src/repositories/clientApplicationAllowedExtensionRepository.ts

Extractor Management Endpoints

MethodPathPurposeStatusDocumented
POST/v1/clientApplication/{id}/extractor/Add extractor to client appImplementedYes
GET/v1/clientApplication/{id}/extractor/Get extractors for client appImplementedYes
DELETE/v1/clientApplication/{id}/extractor/{extractorId}Remove extractorImplementedYes

Implementation Files:

  • Routes: src/routes/v1/clientApplicationExtractor.ts
  • Controller: src/controllers/clientApplicationExtractorController.ts
  • Repository: src/repositories/clientApplicationExtractorRepository.ts

Utility Endpoints

MethodPathPurposeStatusDocumented
GET/docsSwagger UI documentationImplementedYes
GET/openapi.yamlOpenAPI YAML specImplementedYes
GET/healthHealth check endpointImplementedYes, it is part of the framework

No.SeverityDescription
1MediumAdd integration test coverage for Client endpoints to match the coverage level of Client Application endpoints

Code

Potential optimizations and improvements have been included in the table below.

No.SeverityDescriptionReferences
1LowValidation logic is split between JSON schemas and preValidation hooks. Move simple validation (whitespace, min/max) into schemas.src/routes/v1/clientApplication.ts, src/routes/v1/schemas.ts
2LowMissing integration tests for Client endpoints. Unit tests exist but integration tests are not yet implemented for POST, GET, PATCH, and DELETE operations on /v1/client/ endpoints.test/service/
3Low@azure/storage-blob is in package.json but not used anywhere. Remove if not needed.package.json
4Mediumsrc/routes/v1/schemas.ts consider segregating the schema for each routeschemas.ts
5MediumConsider another layer for services this should handle business rules/logicsrc/services/registrationService.ts
7MediumConfiguration keys are scattered across code using string-based app.lookup() calls. While ENV_KEYS constant exists, it’s not enforced. Consider creating a config validation function that verifies all required keys exist at startup.src/index.ts, src/services/topicService.ts, src/internal/createSqlConnectionOptions.ts

Documentation

Below are the suggested changes to the documentation.

No.DocumentSeverityDescriptionReferences
1Code CommentsLowDocument why trailing URL space handling exists or investigate if client-side bug can be fixed. Probably this is because of the fastify case sensitive in endpointssrc/index.ts lines 140-153