mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
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)
113 lines
3.5 KiB
JSON
113 lines
3.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://cityresourcegraph.com/schemas/match.json",
|
|
"title": "Match Entity",
|
|
"description": "Match between resource flows with state management and conflict resolution",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Unique match identifier"
|
|
},
|
|
"compatibility_score": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1,
|
|
"description": "Overall compatibility score (0-1)"
|
|
},
|
|
"economic_value": {
|
|
"type": "number",
|
|
"description": "Estimated annual economic value (€)"
|
|
},
|
|
"distance_km": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"description": "Distance between sites (km)"
|
|
},
|
|
"source_resource_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Source resource flow ID"
|
|
},
|
|
"target_resource_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Target resource flow ID"
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"enum": ["suggested", "negotiating", "reserved", "contracted", "live", "failed", "cancelled"],
|
|
"default": "suggested",
|
|
"description": "Current match state"
|
|
},
|
|
"priority": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 10,
|
|
"description": "Match priority (higher number = higher priority)"
|
|
},
|
|
"reserved_until": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When reservation expires (for reserved status)"
|
|
},
|
|
"transportation_estimate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cost_per_year": {"type": "number"},
|
|
"method": {"type": "string"},
|
|
"feasibility_score": {"type": "number", "minimum": 0, "maximum": 1}
|
|
}
|
|
},
|
|
"risk_assessment": {
|
|
"type": "object",
|
|
"properties": {
|
|
"technical_risk": {"type": "number", "minimum": 0, "maximum": 1},
|
|
"regulatory_risk": {"type": "number", "minimum": 0, "maximum": 1},
|
|
"market_risk": {"type": "number", "minimum": 0, "maximum": 1}
|
|
}
|
|
},
|
|
"negotiation_history": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"timestamp": {"type": "string", "format": "date-time"},
|
|
"actor": {"type": "string", "format": "uuid"},
|
|
"action": {"type": "string"},
|
|
"notes": {"type": "string", "maxLength": 1000}
|
|
},
|
|
"required": ["timestamp", "actor", "action"]
|
|
},
|
|
"description": "History of negotiation activities"
|
|
},
|
|
"contract_details": {
|
|
"type": "object",
|
|
"properties": {
|
|
"contract_id": {"type": "string", "format": "uuid"},
|
|
"signed_at": {"type": "string", "format": "date-time"},
|
|
"effective_from": {"type": "string", "format": "date-time"},
|
|
"value_per_year": {"type": "number"},
|
|
"terms_url": {"type": "string", "format": "uri"}
|
|
},
|
|
"description": "Contract details when status is contracted or live"
|
|
},
|
|
"failure_reason": {
|
|
"type": "string",
|
|
"maxLength": 500,
|
|
"description": "Reason for failure (when status is failed)"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"required": ["id", "compatibility_score", "economic_value", "source_resource_id", "target_resource_id"],
|
|
"additionalProperties": false
|
|
}
|