How laurentmor/tradeform-service works
TradeForm Service is a Spring Boot REST API for status and trade-form lookups. An HTTP client calls the controller, which delegates to the service; the service validates IDs, queries the repository and maps entities to API DTOs, while global exception handling converts domain errors to HTTP responses. The README describes the lookup as synthetic, but the sampled service implementation queries the repository; this graph follows the sampled code. The README documents PostgreSQL/JPA persistence, though database wiring is not shown in the excerpts.
Main entry points: TradeFormServiceImpl.java Trade Form Service · TradeFormControllerImpl.java REST Controller · ITradeFormRepository.java JPA Repository · TradeFormEntity.java Trade Form Entity
Components 15
HTTP API
- REST Controller
src/main/java/com/lm/tradeformservice/controller/impl/TradeFormControllerImpl.java - HTTP Contract
src/main/java/com/lm/tradeformservice/controller/ITradeFormController.java
Trade Form Logic
- Service Contract
src/main/java/com/lm/tradeformservice/service/ITradeFormService.java - Trade Form Service
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - Trade Form DTO
src/main/java/com/lm/tradeformservice/dto/TradeForm.java - Form Status
src/main/java/com/lm/tradeformservice/dto/TradeFormStatus.java
Persistence Model
- JPA Repository
src/main/java/com/lm/tradeformservice/repository/ITradeFormRepository.java - Trade Form Entity
src/main/java/com/lm/tradeformservice/entity/TradeFormEntity.java - PostgreSQL
Application Support
- Negative ID Error
src/main/java/com/lm/tradeformservice/exception/data/NegativeTradeFormIdException.java - Not Found Error
src/main/java/com/lm/tradeformservice/exception/data/TradeFormNotFoundException.java - HTTP Error Handler
src/main/java/com/lm/tradeformservice/config/ExceptionHandlingConfig.java - Mapper Configuration
src/main/java/com/lm/tradeformservice/config/MapperConfig.java - Spring Boot Entry
src/main/java/com/lm/tradeformservice/TradeFormServiceApplication.java
Other components
- HTTP Client
Connections 17
- HTTP Client → REST Controller: sends requests
README.md - REST Controller → Service Contract: delegates requests
src/main/java/com/lm/tradeformservice/controller/impl/TradeFormControllerImpl.java - REST Controller → HTTP Contract: implements routes
src/main/java/com/lm/tradeformservice/controller/impl/TradeFormControllerImpl.java - Trade Form Service → Service Contract: implements operations
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - Trade Form Service → JPA Repository: queries and saves
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - JPA Repository → Trade Form Entity: persists records
src/main/java/com/lm/tradeformservice/repository/ITradeFormRepository.java - JPA Repository → PostgreSQL: accesses storage
README.md - Trade Form Service → Trade Form DTO: maps responses
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - Trade Form Service → Trade Form Entity: maps records
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - Trade Form Entity → Form Status: stores status
src/main/java/com/lm/tradeformservice/entity/TradeFormEntity.java - Trade Form DTO → Form Status: contains status
src/main/java/com/lm/tradeformservice/dto/TradeForm.java - Trade Form Service → Negative ID Error: rejects negative IDs
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - Trade Form Service → Not Found Error: raises when absent
src/main/java/com/lm/tradeformservice/service/impl/TradeFormServiceImpl.java - HTTP Error Handler → Negative ID Error: handles errors
src/main/java/com/lm/tradeformservice/config/ExceptionHandlingConfig.java - HTTP Error Handler → Not Found Error: handles errors
src/main/java/com/lm/tradeformservice/config/ExceptionHandlingConfig.java - Trade Form Service → Mapper Configuration: uses configured mapper
- Spring Boot Entry → REST Controller: starts application