- Initialize git repository - Add comprehensive .gitignore for Go projects - Install golangci-lint v2.6.0 (latest v2) globally - Configure .golangci.yml with appropriate linters and formatters - Fix all formatting issues (gofmt) - Fix all errcheck issues (unchecked errors) - Adjust complexity threshold for validation functions - All checks passing: build, test, vet, lint
3.5 KiB
5. Entity Relationships
The platform uses a three-tier entity model to accurately represent real-world industrial ecosystems:
Business Entity
Represents the legal/commercial entity - the company that SMEs identify with. Contains business capabilities, certifications, strategic profile, and relationships.
Site Entity
Represents physical locations/buildings where business activities occur. A business can operate at multiple sites (multi-site operations, industrial parks). Sites have their own infrastructure, utilities, and environmental characteristics.
Resource Flows
Attached to specific sites where they physically occur, owned by businesses. This allows:
- Multi-site businesses with different resource profiles per location
- Shared assets located at specific sites
- Accurate geographical matching and logistics planning
Relationship: Business owns/operates Sites, Sites host ResourceFlows and SharedAssets.
Multi-Modal Matching
The same engine now matches across 4 dimensions:
- Resource flows (original): Physics-based surplus-to-demand
- Service complementarity: "I service compressors, you have 30 compressors"
- Product supply chains: "I need packaging, you produce it 2km away"
- Compliance networks: "We both need oil separator cleaning → group buy"
UX Features for Felt Value
"Nearby Buyers & Suppliers"
Every resource card shows:
- Resource matches (existing functionality)
- Relevant suppliers (products for this process)
- Service providers (equipment maintenance)
"Shared OPEX Deals"
Cluster by recurring costs and offer group discounts:
- "3 of you can save 12% on waste pickup"
- "5 companies can get PPE bulk pricing"
"Opportunities Feed"
Timeline of local business opportunities:
- "Bakery A needs cold storage 5-10 m³ nearby"
- "Packaging C wants new suppliers within 10 km"
- "Pool B can take 20 kW low-temp heat"
Service-as-a-Resource
Formalize services as first-class resources:
For complete ResourceFlow schema, see schemas/resource_flow.json
Now match: "Plant emits 'faulty pumps' → 3 local companies output 'pump maintenance within 25km'"
Layered Architecture
Layer 1 (Core): Strict, typed, physics/economics-checked flows
Layer 2 (Business): Fuzzy, texty, lower-trust, human-verified
Matching priority:
- Try hard match (physics)
- If <N results, add soft match (business/services)
- Surface both but label differently
This keeps the platform serious for utilities while being sticky for SMEs.
Match State Management & Conflict Resolution
Edge State Machine (prevents double-booking of matches):
suggested: Match discovered by algorithmnegotiating: Both parties contacted, initial discussionsreserved: Match committed to (exclusive for N days)contracted: Legal agreement signedlive: Implementation in progressfailed: Match abandoned
Conflict Resolution: When multiple buyers want same resource:
- Priority: Contracted > Reserved > Negotiating > Suggested
- Time-based: First to reserve gets priority
- Economic: Higher value matches override lower ones
Execution Support Entities
Match Packet (partner-ready deliverables):
For complete MatchPacket schema, see schemas/match_packet.json
Facilitator Marketplace (external engineers as paid intermediaries):
For complete Facilitator schema, see schemas/facilitator.json