mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
- 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
52 lines
2.3 KiB
Markdown
52 lines
2.3 KiB
Markdown
# JSON Schemas
|
|
|
|
This directory contains JSON Schema definitions for all entities in the Turash platform.
|
|
|
|
## Core Data Model Schemas
|
|
|
|
- **`business.json`** - Legal/commercial entity representation with contact details, certifications, and strategic profile
|
|
- **`site.json`** - Physical locations/buildings with geographical coordinates, infrastructure, and environmental data
|
|
- **`resource_flow.json`** - Resource inputs/outputs with quality parameters, quantities, costs, and temporal profiles
|
|
- **`shared_asset.json`** - Equipment and infrastructure that can be shared among businesses at specific sites
|
|
|
|
## API Request/Response Schemas
|
|
|
|
- **`match_query_request.json`** - Request schema for finding resource matches with constraints and pagination
|
|
- **`match_response.json`** - Response schema for match results with metadata and compatibility scores
|
|
- **`business_registration.json`** - Schema for new business onboarding with initial sites and resources
|
|
- **`economic_calculation.json`** - Schema for economic viability calculations with NPV, IRR, and payback analysis
|
|
- **`websocket_event.json`** - Schema for real-time WebSocket events (matches, updates, notifications, system status)
|
|
- **`configuration.json`** - Application configuration schema for server, database, cache, and feature flags
|
|
|
|
## Execution Support Schemas
|
|
|
|
- **`match.json`** - Match entity with state management (suggested → negotiating → contracted → live)
|
|
- **`match_packet.json`** - Partner-ready deliverables with technical details, legal templates, and cost calculators
|
|
- **`facilitator.json`** - External engineers and consultants marketplace with specialties, rates, and ratings
|
|
|
|
## Schema Validation
|
|
|
|
All schemas follow JSON Schema Draft 2020-12 and include:
|
|
- Type validation and format constraints
|
|
- Required field specifications
|
|
- String length limits and pattern matching
|
|
- Numeric ranges and enumerations
|
|
- Cross-schema references using `$ref`
|
|
|
|
## Usage
|
|
|
|
These schemas are used for:
|
|
- API request/response validation
|
|
- Database document validation
|
|
- Type-safe code generation
|
|
- Documentation generation
|
|
- Data migration validation
|
|
|
|
## Validation Tools
|
|
|
|
Use these tools to validate data against the schemas:
|
|
- `ajv` (Node.js)
|
|
- `jsonschema` (Python)
|
|
- `gojsonschema` (Go)
|
|
- Online validators at json-schema.org
|