turash/docs/concept/schemas/business.json
Damir Mukimov 000eab4740
Major repository reorganization and missing backend endpoints implementation
Repository Structure:
- Move files from cluttered root directory into organized structure
- Create archive/ for archived data and scraper results
- Create bugulma/ for the complete application (frontend + backend)
- Create data/ for sample datasets and reference materials
- Create docs/ for comprehensive documentation structure
- Create scripts/ for utility scripts and API tools

Backend Implementation:
- Implement 3 missing backend endpoints identified in gap analysis:
  * GET /api/v1/organizations/{id}/matching/direct - Direct symbiosis matches
  * GET /api/v1/users/me/organizations - User organizations
  * POST /api/v1/proposals/{id}/status - Update proposal status
- Add complete proposal domain model, repository, and service layers
- Create database migration for proposals table
- Fix CLI server command registration issue

API Documentation:
- Add comprehensive proposals.md API documentation
- Update README.md with Users and Proposals API sections
- Document all request/response formats, error codes, and business rules

Code Quality:
- Follow existing Go backend architecture patterns
- Add proper error handling and validation
- Match frontend expected response schemas
- Maintain clean separation of concerns (handler -> service -> repository)
2025-11-25 06:01:16 +01:00

322 lines
8.1 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cityresourcegraph.com/schemas/business.json",
"title": "Business Entity",
"description": "Legal/commercial entity representation",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Unique business identifier"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "Legal business name"
},
"legal_form": {
"type": "string",
"enum": [
"LLC",
"corporation",
"partnership",
"sole_proprietorship",
"GmbH",
"UG",
"AG"
],
"description": "Legal structure"
},
"primary_contact": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email",
"description": "Primary contact email"
},
"phone": {
"type": "string",
"pattern": "^\\+?[1-9]\\d{1,14}$",
"description": "Primary contact phone (E.164 format)"
}
},
"description": "Primary contact information"
},
"industrial_sector": {
"type": "string",
"pattern": "^\\d{2}(\\.\\d{1,2})?$",
"description": "NACE classification code"
},
"company_size": {
"type": "integer",
"minimum": 1,
"maximum": 100000,
"description": "Number of employees"
},
"years_operation": {
"type": "integer",
"minimum": 0,
"maximum": 500,
"description": "Years in operation"
},
"supply_chain_role": {
"type": "string",
"enum": [
"manufacturer",
"supplier",
"distributor",
"consumer"
],
"description": "Role in supply chain"
},
"certifications": {
"type": "array",
"items": {
"type": "string",
"enum": [
"ISO9001",
"ISO14001",
"HACCP",
"EMAS",
"ISO50001",
"ISO45001"
]
},
"uniqueItems": true,
"description": "Quality and environmental certifications"
},
"business_focus": {
"type": "array",
"items": {
"type": "string",
"enum": [
"local",
"regional",
"national",
"sustainability",
"innovation",
"cost_optimization"
]
},
"uniqueItems": true,
"description": "Strategic business focus areas"
},
"readiness_maturity": {
"type": "integer",
"minimum": 1,
"maximum": 5,
"description": "Industrial symbiosis adoption readiness (1-5 scale)"
},
"strategic_vision": {
"type": "string",
"maxLength": 2000,
"description": "Environmental/economic priorities and strategic vision"
},
"drivers_barriers": {
"type": "string",
"maxLength": 2000,
"description": "Motivation for IS participation and barriers to adoption"
},
"operating_sites": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"description": "Site IDs where this business operates"
},
"existing_symbiotic_relationships": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"description": "Business IDs with existing symbiotic relationships"
},
"trust_network": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"description": "Business IDs in pre-existing trust network"
},
"technical_expertise": {
"type": "array",
"items": {
"type": "string",
"maxLength": 255
},
"description": "Specialized processes, equipment, and technical capabilities"
},
"available_technology": {
"type": "array",
"items": {
"type": "string",
"maxLength": 255
},
"description": "Equipment, machinery, and technology capabilities available"
},
"management_systems": {
"type": "array",
"items": {
"type": "string",
"maxLength": 255
},
"description": "ERP, EMS, SCM, and other management systems in use"
},
"sells_products": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "Product name"
},
"category": {
"type": "string",
"maxLength": 100,
"description": "Product category (packaging, chemicals, equipment, etc.)"
},
"unit_price": {
"type": "number",
"minimum": 0,
"description": "Price per unit in €"
},
"moq": {
"type": "integer",
"minimum": 1,
"description": "Minimum order quantity"
},
"certifications": {
"type": "array",
"items": {
"type": "string",
"maxLength": 100
},
"description": "Product certifications"
}
},
"required": [
"name",
"category",
"unit_price"
]
},
"description": "Products this business sells"
},
"offers_services": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"maintenance",
"consulting",
"transport",
"inspection"
],
"description": "Type of service offered"
},
"domain": {
"type": "string",
"maxLength": 255,
"description": "Service domain (compressors, HVAC, waste_management, etc.)"
},
"on_site": {
"type": "boolean",
"description": "Whether service is performed on-site"
},
"hourly_rate": {
"type": "number",
"minimum": 0,
"description": "Hourly rate in €"
},
"service_area_km": {
"type": "number",
"minimum": 0,
"description": "Service area radius in kilometers"
},
"certifications": {
"type": "array",
"items": {
"type": "string",
"maxLength": 100
},
"description": "Service provider certifications"
}
},
"required": [
"type",
"domain",
"hourly_rate",
"service_area_km"
]
},
"description": "Services this business offers"
},
"needs_services": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"maxLength": 255,
"description": "Type of service needed"
},
"urgency": {
"type": "string",
"enum": [
"low",
"medium",
"high"
],
"default": "medium",
"description": "Urgency level of the service need"
},
"budget": {
"type": "number",
"minimum": 0,
"description": "Available budget in €"
},
"preferred_providers": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"description": "Preferred business IDs for this service"
}
},
"required": [
"type"
]
},
"description": "Services this business needs"
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Record creation timestamp"
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp"
}
},
"required": [
"id",
"name",
"email"
],
"additionalProperties": false
}