Skip to main content

Quotes

Overview (C4 Component)

Black-box description of components

ComponentResponsibilityProvided Interface(s)Consumed Interface(s)
QuoteControllerEntry point for quote CRUD & status updates.REST /api/v1/quotes/** (OpenAPI)
QuoteServiceImplements all quote use-cases; assigns numbers, authorises, validates; coordinates sub-services; fires domain events.Java/Spring service (called only by the controller)Repos, Status Service, Number Generator, Mapper, DomainEventPublisher, RequestForQuotationStatusService
QuoteRepositoryPersistence of Quote aggregate.Spring-Data JPAMySQL via JDBC
QuoteNumberGeneratorCreates sequential numbers using a per-year QuoteNumberSequence.Java classQuoteNumberSequenceRepository
QuoteStatusServicePure domain logic: legal status transitions & side-effects.Java classQuoteRepository, RequestForQuotationStatusService
QuoteMapper / QuoteMapperResolverMapStruct mappers + helper to resolve Provider & Truck.Java interface / componentProviderService, TruckService
DomainEventPublisherPublishes Spring events (QuoteCreatedEvent, QuoteStatusChangedEvent, QuoteCancelledByEsUserEvent).Spring ApplicationEventPublisher
QuoteNotificationListenerListens to quote events, calls NotificationService (external) to push e-mail + WebSocket.Spring event listenerDomain events
QuoteNumberSequenceRepositoryPersists per-year numeric sequence.Spring-Data JPAMySQL
Entities (Quote, QuoteNumberSequence)ORM mapping of aggregates and sequence table.JPA

Important internal interfaces

NameSignature / ProtocolNotes
provideQuotePOST /api/v1/requestForQuotationsItems/{rfqItemId}/quotes – body QuoteCreateRequestProvider-only; validates provider is assigned to RFQ.
listQuotesForItemGET /api/v1/requestForQuotationsItems/{rfqItemId}/quotesES staff see all, providers see only their own.
updateQuotePUT /api/v1/quotes/{number}Allowed for ES staff or quote author while status = PENDING.
patchQuoteStatusPATCH /api/v1/quotes/{number} – body {status}Uses QuoteStatusService.changeStatus(...); can trigger cascaded status changes.
Quote-created eventQuoteCreatedEvent { quoteId }Translates into notification & RFQ item status recalculation.
Quote-status-changed eventQuoteStatusChangedEvent { quoteId, newStatus }Same consumer flow.
Quote-cancelled-by-staff eventQuoteCancelledByEsUserEvent { quoteId }Triggered when ES user withdraws a quote.