Supplier Module Specification¶
Purpose¶
The supplier module implements the Supplier Domain inside the Spring Boot Modulith. It owns supplier-specific profiles, capabilities, customer-supplier relationships, quotes, performance records, ratings, reviews, response-time records, preferred supplier state, and supplier trust assessments.
Owned Domain¶
Supplier owns supplier facts and relationship state. It does not own customer organization facts, marketplace listing workflow, contract delivery state, or AI reasoning sessions.
Owned Aggregates¶
| Aggregate | Responsibility |
|---|---|
| Supplier Profile | Root aggregate for supplier identity, categories, regions, contacts, and status. |
| Supplier Capability Profile | Offerings, capability evidence, categories, coverage, and verification signals. |
| Supplier Relationship | Customer-specific supplier relationship, preferred status, notes, and trust context. |
| Supplier Quote Register | Quote records, validity, response behavior, and quote status. |
| Supplier Performance Register | Performance records, ratings, reviews, and previous contract references. |
| Supplier Trust Assessment | Trust score, risk signals, evidence, review status, and explainable trust level. |
Owned Entities¶
Supplier Profile, Supplier Contact, Supplier Capability, Supplier Relationship, Supplier Quote, Supplier Performance Record, Supplier Rating, Supplier Review, Response Time Record, and Previous Contract Reference.
Owned Value Objects¶
SupplierProfileId, SupplierRelationshipId, SupplierStatus, SupplierRelationshipStatus, SupplierCategory, SupplierRegion, SupplierTrustLevel, SupplierRatingScore, ResponseTime, QuoteValidityPeriod, QuoteStatus, and VerificationSignalType.
Commands¶
| Command | Responsibility |
|---|---|
| CreateSupplierProfile | Create a stable supplier profile. |
| UpdateSupplierProfile | Change supplier-owned profile fields. |
| AddSupplierCapability | Add supplier offering or capability. |
| CreateSupplierRelationship | Link customer organization to supplier relationship context. |
| MarkSupplierPreferred | Mark supplier preferred for a specific organization relationship. |
| RequestSupplierQuote | Start supplier quote tracking. |
| RecordSupplierQuote | Capture supplier quote amount, validity, and status. |
| RecordSupplierPerformance | Accept performance signal from contract or interaction context. |
| AddSupplierRating | Record structured rating with reason. |
| AddSupplierReview | Record attributable qualitative review. |
| RecordResponseTime | Capture response-time evidence. |
| UpdateSupplierTrust | Recalculate or approve trust state from evidence. |
| ReviewSupplierAIRecommendation | Accept, reject, or route AI supplier recommendation. |
Queries¶
| Query | Responsibility |
|---|---|
| GetSupplierProfile | Return supplier profile summary. |
| SearchSuppliers | Return supplier profiles by category, region, capability, and trust state. |
| GetSupplierCapabilities | Return capability and evidence summary. |
| GetSupplierRelationships | Return customer-specific supplier relationships. |
| GetPreferredSuppliers | Return preferred suppliers for an organization. |
| GetSupplierQuotes | Return quote records and validity state. |
| GetSupplierPerformance | Return performance and previous contract summaries. |
| GetSupplierRatingsAndReviews | Return rating and review summaries where authorized. |
| GetSupplierTrust | Return explainable trust state and evidence. |
Application Services¶
SupplierProfileApplicationService, SupplierCapabilityApplicationService, SupplierRelationshipApplicationService, SupplierQuoteApplicationService, SupplierPerformanceApplicationService, SupplierRatingApplicationService, PreferredSupplierApplicationService, SupplierTrustApplicationService, and SupplierAIReviewApplicationService.
Domain Services¶
SupplierProfileCreationService, SupplierRelationshipService, SupplierCapabilityService, QuoteValidityService, PerformanceRecordingService, RatingReviewService, PreferredSupplierService, TrustUpdateService, and AIRecommendationReviewService.
Policies¶
Supplier Profile Creation Policy, Supplier Relationship Policy, Supplier Capability Policy, Quote Validity Policy, Performance Recording Policy, Rating Review Policy, Preferred Supplier Policy, Trust Update Policy, and AI Recommendation Review Policy.
Repositories¶
SupplierProfileRepository, SupplierContactRepository, SupplierCapabilityRepository, SupplierRelationshipRepository, SupplierQuoteRepository, SupplierPerformanceRepository, SupplierRatingRepository, SupplierReviewRepository, SupplierResponseTimeRepository, PreferredSupplierRepository, SupplierTrustRepository, and SupplierAuditRepository.
Events Published¶
SupplierProfileCreated, SupplierProfileUpdated, SupplierCapabilityAdded, SupplierRelationshipCreated, SupplierPreferred, SupplierQuoteRequested, SupplierQuoteReceived, SupplierPerformanceRecorded, SupplierRatingAdded, SupplierReviewAdded, and SupplierTrustUpdated.
Events Consumed¶
MarketplaceListingCreated, QuoteRequestCreated, QuoteRequestResponded, ContractWorkspaceCreated, SupplierCoordinationRecorded, ContractPerformanceUpdated, ContractClosedOut, OrganizationProfileUpdated, AIRecommendationProduced, and AdministrativePolicyChanged.
REST API Responsibility¶
The module owns API responsibilities for supplier profiles, supplier capabilities, supplier relationships, supplier quotes, supplier performance, ratings, reviews, trust state, and preferred supplier relationships. Final endpoint paths are deferred.
Database Ownership¶
Supplier owns conceptual persistence for supplier profiles, supplier contacts, supplier capabilities, supplier relationships, supplier quotes, supplier performance records, supplier ratings, supplier reviews, response-time records, previous contract references, preferred suppliers, trust assessments, and supplier audit logs.
Module Dependencies¶
Allowed dependencies are shared kernel identifiers, identity authorization context, organization customer context references, marketplace listing and quote-request events, contract performance events, notification quote and review triggers, analytics projections, and intelligence recommendation boundaries.
Forbidden Dependencies¶
Supplier must not mutate Organization profile facts, Marketplace listings or display state, Contract delivery records, Funding applications, Intelligence reasoning records, Notification delivery records, or Analytics projections. Marketplace must not become the canonical supplier trust store.
AIOS Interaction Boundary¶
AIOS may recommend suppliers, classify supplier capabilities, summarize performance, propose trust changes, or flag quote risks. Supplier policies decide whether those suggestions become supplier facts.
Security And Tenant Rules¶
- Supplier profiles may be platform-visible, but relationships, preferred status, quotes, ratings, and reviews are tenant-scoped.
- Quote data and performance feedback require organization context and authorization.
- Trust state must be explainable and evidence-backed.
- Reviews and ratings must preserve author, source, moderation, and audit context.
- Cross-tenant supplier search must not expose customer-private notes or relationship state.
Test Strategy¶
Tests must cover profile creation, capability updates, relationship scoping, preferred supplier rules, quote validity, performance acceptance, rating moderation, trust calculation, AI recommendation review, event publication, idempotent consumption, tenant filtering, and Spring Modulith boundaries.
Future Microservice Extraction Notes¶
Supplier can be extracted as marketplace and supplier-network volume grows. Extraction requires stable supplier profile APIs, relationship APIs, quote events, performance event contracts from Contract, and clear separation from Marketplace display storage.
Mermaid Component Diagram¶
flowchart TD
Api[supplier.api.rest]
App[supplier.application.service]
Command[supplier.application.command]
Query[supplier.application.query]
Domain[supplier.domain.model]
Policy[supplier.domain.policy]
Repo[supplier.infrastructure.persistence]
Messaging[supplier.infrastructure.messaging]
Organization[organization context]
Marketplace[marketplace workflows]
Contract[contract performance]
Intelligence[intelligence recommendations]
Analytics[analytics projections]
Api --> App
App --> Command
App --> Query
App --> Domain
Domain --> Policy
App --> Repo
App --> Messaging
App --> Organization
App --> Marketplace
App --> Contract
App --> Intelligence
Messaging --> Analytics