Skip to main content

Request for quotations

Overview (C4 Component)

Black-box description of components

ComponentResponsibilityProvided Interface(s)Consumed Interface(s)
RequestForQuotationsControllerEntry point for RFQ CRUD & status PATCH.REST /api/v1/rfqs/** (OpenAPI)
RequestForQuotationServiceImplements all RFQ use-cases; enforces authorisation & validation; coordinates sub-services.Java/Spring service API (called only by the controller)JPA Repos, Status Service, Number Generator, Mapper, DomainEventPublisher
RequestForQuotationRepositoryPersistence of RequestForQuotation aggregate.Spring-Data JPAMySQL © JDBC
RequestForQuotationItemRepositoryPersistence of item sub-aggregate.Spring-Data JPAMySQL
RequestForQuotationStatusServicePure domain logic: compute legal status and cascades.Java class
RfqNumberGeneratorProduces sequential numbers using a Year-Sequence table.Java classRfqNumberSequenceRepository (not shown)
RequestForQuotationsMapper / ItemMapperMapStruct mappers DTO ⇄ Entity.Java interface
DomainEventPublisherPublishes Spring events (RequestForQuotationCreatedEvent, StatusChangedEvent).Spring ApplicationEventPublisher
RequestForQuotationNotificationListenerConverts domain events into notifications (e-mail & WebSocket).Spring event listenerNotificationService (external package)

Important internal interfaces

NameSignature / ProtocolNotes
createRFQPOST /api/v1/requestForQuotations – body RequestForQuotationCreateRequestValidates body, returns 201 Created with RequestForQuotationResponse.
updateRFQPUT /api/v1/requestForQuotations/{year}/{seq}/{ver}Idempotent version bump, forbidden if status ≠ OPEN/IN_PROGRESS.
patchRFQStatusPATCH /api/v1/requestForQuotations/{y}/{s}/{v}/status – body {status}Uses RequestForQuotationStatusService.canTransition(...).
RFQ-created eventSpring event object { rfqId: Long }Consumed by NotificationListener → e-mail + WebSocket push.