demo seed change
This commit is contained in:
102
shared/demo/schemas/forecasting/forecast.schema.json
Normal file
102
shared/demo/schemas/forecasting/forecast.schema.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Forecast",
|
||||
"description": "Schema for demand forecast data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"product_id",
|
||||
"forecast_date",
|
||||
"predicted_quantity",
|
||||
"confidence_score",
|
||||
"forecast_horizon_days",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the forecast"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"product_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Product identifier"
|
||||
},
|
||||
"forecast_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Forecast date"
|
||||
},
|
||||
"predicted_quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Predicted quantity"
|
||||
},
|
||||
"confidence_score": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Confidence score (0-1)"
|
||||
},
|
||||
"forecast_horizon_days": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Forecast horizon in days"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes"
|
||||
},
|
||||
"enterprise_forecast": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level forecast"
|
||||
},
|
||||
"forecast_type": {
|
||||
"type": "string",
|
||||
"description": "Type of forecast"
|
||||
},
|
||||
"contract_reference": {
|
||||
"type": "string",
|
||||
"description": "Contract reference"
|
||||
},
|
||||
"customer_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Customer identifier"
|
||||
},
|
||||
"delivery_locations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Delivery locations"
|
||||
},
|
||||
"reasoning_data": {
|
||||
"type": "object",
|
||||
"description": "Reasoning data for special forecasts",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Reasoning type"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"description": "Reasoning parameters"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
181
shared/demo/schemas/inventory/ingredient.schema.json
Normal file
181
shared/demo/schemas/inventory/ingredient.schema.json
Normal file
@@ -0,0 +1,181 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://schemas.bakery-ia.com/demo/inventory/ingredient/v1",
|
||||
"type": "object",
|
||||
"title": "Ingredient",
|
||||
"description": "Ingredient or finished product for demo cloning",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique ingredient identifier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant owner (replaced during cloning)"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 255
|
||||
},
|
||||
"sku": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"barcode": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 50
|
||||
},
|
||||
"product_type": {
|
||||
"type": "string",
|
||||
"enum": ["ingredient", "finished_product"],
|
||||
"description": "Type of product in inventory"
|
||||
},
|
||||
"ingredient_category": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["flour", "yeast", "dairy", "eggs", "sugar", "fats", "salt", "spices", "additives", "packaging", "cleaning", "other"]
|
||||
},
|
||||
"product_category": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["bread", "croissants", "pastries", "cakes", "cookies", "muffins", "sandwiches", "seasonal", "beverages", "other_products"]
|
||||
},
|
||||
"subcategory": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"description": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"brand": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"unit_of_measure": {
|
||||
"type": "string",
|
||||
"enum": ["kg", "g", "l", "ml", "units", "pcs", "pkg", "bags", "boxes"]
|
||||
},
|
||||
"package_size": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"average_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"last_purchase_price": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"standard_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"low_stock_threshold": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"reorder_point": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"reorder_quantity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"max_stock_level": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"shelf_life_days": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"display_life_hours": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"best_before_hours": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"storage_instructions": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"central_baker_product_code": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"delivery_days": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 20
|
||||
},
|
||||
"minimum_order_quantity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"pack_size": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"is_active": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"is_perishable": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"allergen_info": {
|
||||
"type": ["array", "null"],
|
||||
"items": {"type": "string"}
|
||||
},
|
||||
"nutritional_info": {
|
||||
"type": ["object", "null"]
|
||||
},
|
||||
"produced_locally": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"recipe_id": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to recipes.Recipe for local production"
|
||||
},
|
||||
"created_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"created_by": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id", "tenant_id", "name", "product_type", "unit_of_measure", "is_active", "is_perishable", "produced_locally"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {"product_type": {"const": "finished_product"}}
|
||||
},
|
||||
"then": {
|
||||
"required": ["product_category"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {"product_type": {"const": "ingredient"}}
|
||||
},
|
||||
"then": {
|
||||
"required": ["ingredient_category"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
159
shared/demo/schemas/inventory/stock.schema.json
Normal file
159
shared/demo/schemas/inventory/stock.schema.json
Normal file
@@ -0,0 +1,159 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://schemas.bakery-ia.com/demo/inventory/stock/v1",
|
||||
"type": "object",
|
||||
"title": "Stock",
|
||||
"description": "Stock levels and batch tracking for demo cloning",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique stock identifier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant owner (replaced during cloning)"
|
||||
},
|
||||
"ingredient_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Reference to inventory.Ingredient"
|
||||
},
|
||||
"supplier_id": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to suppliers.Supplier"
|
||||
},
|
||||
"batch_number": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"lot_number": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"supplier_batch_ref": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"production_stage": {
|
||||
"type": "string",
|
||||
"enum": ["raw_ingredient", "par_baked", "fully_baked", "prepared_dough", "frozen_product"],
|
||||
"default": "raw_ingredient"
|
||||
},
|
||||
"transformation_reference": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"current_quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
"reserved_quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
"available_quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
"received_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"expiration_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"best_before_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"original_expiration_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"transformation_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"final_expiration_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"unit_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"total_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"storage_location": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"warehouse_zone": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 50
|
||||
},
|
||||
"shelf_position": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 50
|
||||
},
|
||||
"requires_refrigeration": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"requires_freezing": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"storage_temperature_min": {
|
||||
"type": ["number", "null"]
|
||||
},
|
||||
"storage_temperature_max": {
|
||||
"type": ["number", "null"]
|
||||
},
|
||||
"storage_humidity_max": {
|
||||
"type": ["number", "null"]
|
||||
},
|
||||
"shelf_life_days": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"storage_instructions": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"is_available": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"is_expired": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"quality_status": {
|
||||
"type": "string",
|
||||
"enum": ["good", "damaged", "expired", "quarantined"],
|
||||
"default": "good"
|
||||
},
|
||||
"created_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id", "tenant_id", "ingredient_id", "current_quantity", "reserved_quantity", "available_quantity",
|
||||
"is_available", "is_expired", "quality_status"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
137
shared/demo/schemas/orders/customer.schema.json
Normal file
137
shared/demo/schemas/orders/customer.schema.json
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Customer",
|
||||
"description": "Schema for customer data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"customer_code",
|
||||
"name",
|
||||
"customer_type",
|
||||
"contact_person",
|
||||
"email",
|
||||
"phone",
|
||||
"address",
|
||||
"city",
|
||||
"postal_code",
|
||||
"country",
|
||||
"status",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the customer"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"customer_code": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "Customer code"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 100,
|
||||
"description": "Customer name"
|
||||
},
|
||||
"customer_type": {
|
||||
"type": "string",
|
||||
"enum": ["RETAIL", "WHOLESALE", "ENTERPRISE", "ONLINE"],
|
||||
"description": "Customer type"
|
||||
},
|
||||
"contact_person": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 100,
|
||||
"description": "Primary contact person"
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"format": "email",
|
||||
"description": "Contact email"
|
||||
},
|
||||
"phone": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 20,
|
||||
"description": "Contact phone number"
|
||||
},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 200,
|
||||
"description": "Street address"
|
||||
},
|
||||
"city": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "City"
|
||||
},
|
||||
"postal_code": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 10,
|
||||
"description": "Postal code"
|
||||
},
|
||||
"country": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "Country"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["ACTIVE", "INACTIVE", "PENDING", "SUSPENDED"],
|
||||
"description": "Customer status"
|
||||
},
|
||||
"total_orders": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Total orders placed"
|
||||
},
|
||||
"total_spent": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Total amount spent in EUR"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes"
|
||||
},
|
||||
"enterprise_customer": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level customer"
|
||||
},
|
||||
"contract_type": {
|
||||
"type": "string",
|
||||
"description": "Contract type"
|
||||
},
|
||||
"annual_volume_commitment": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Annual volume commitment"
|
||||
},
|
||||
"delivery_locations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Delivery locations"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
116
shared/demo/schemas/orders/customer_order.schema.json
Normal file
116
shared/demo/schemas/orders/customer_order.schema.json
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "CustomerOrder",
|
||||
"description": "Schema for customer order data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"customer_id",
|
||||
"order_number",
|
||||
"order_date",
|
||||
"delivery_date",
|
||||
"status",
|
||||
"total_amount",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the customer order"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"customer_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Customer identifier"
|
||||
},
|
||||
"order_number": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "Order number"
|
||||
},
|
||||
"order_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Order date"
|
||||
},
|
||||
"delivery_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Delivery date"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["DRAFT", "PENDING", "PROCESSING", "DELIVERED", "CANCELLED", "REJECTED"],
|
||||
"description": "Order status"
|
||||
},
|
||||
"total_amount": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Total order amount in EUR"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes"
|
||||
},
|
||||
"is_urgent": {
|
||||
"type": "boolean",
|
||||
"description": "Urgent order flag"
|
||||
},
|
||||
"enterprise_order": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level order"
|
||||
},
|
||||
"contract_reference": {
|
||||
"type": "string",
|
||||
"description": "Contract reference"
|
||||
},
|
||||
"delivery_locations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "string"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
},
|
||||
"delivery_time": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Delivery locations"
|
||||
},
|
||||
"reasoning_data": {
|
||||
"type": "object",
|
||||
"description": "Reasoning data for urgent orders",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Reasoning type"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"description": "Reasoning parameters"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
104
shared/demo/schemas/procurement/purchase_order.schema.json
Normal file
104
shared/demo/schemas/procurement/purchase_order.schema.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "PurchaseOrder",
|
||||
"description": "Schema for purchase order data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"po_number",
|
||||
"supplier_id",
|
||||
"order_date",
|
||||
"expected_delivery_date",
|
||||
"status",
|
||||
"total_amount",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the purchase order"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"po_number": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "Purchase order number"
|
||||
},
|
||||
"supplier_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Supplier identifier"
|
||||
},
|
||||
"order_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Order date"
|
||||
},
|
||||
"expected_delivery_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Expected delivery date"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["DRAFT", "PENDING", "APPROVED", "DELIVERED", "CANCELLED", "REJECTED"],
|
||||
"description": "Purchase order status"
|
||||
},
|
||||
"total_amount": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Total order amount in EUR"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes"
|
||||
},
|
||||
"reasoning_data": {
|
||||
"type": "object",
|
||||
"description": "Reasoning data for urgent orders",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Reasoning type"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"description": "Reasoning parameters"
|
||||
}
|
||||
}
|
||||
},
|
||||
"enterprise_order": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level order"
|
||||
},
|
||||
"contract_reference": {
|
||||
"type": "string",
|
||||
"description": "Contract reference"
|
||||
},
|
||||
"payment_terms": {
|
||||
"type": "string",
|
||||
"description": "Payment terms"
|
||||
},
|
||||
"delivery_location": {
|
||||
"type": "string",
|
||||
"description": "Delivery location"
|
||||
},
|
||||
"incoterms": {
|
||||
"type": "string",
|
||||
"description": "International commercial terms"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "PurchaseOrderItem",
|
||||
"description": "Schema for purchase order item data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"po_id",
|
||||
"ingredient_id",
|
||||
"quantity",
|
||||
"unit_price",
|
||||
"total_price",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the purchase order item"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"po_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Purchase order identifier"
|
||||
},
|
||||
"ingredient_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Ingredient identifier"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Quantity ordered"
|
||||
},
|
||||
"unit_price": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Unit price in EUR"
|
||||
},
|
||||
"total_price": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Total price in EUR"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes"
|
||||
},
|
||||
"enterprise_item": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level item"
|
||||
},
|
||||
"delivery_schedule": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"delivery_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
},
|
||||
"location": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Delivery schedule"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
261
shared/demo/schemas/production/batch.schema.json
Normal file
261
shared/demo/schemas/production/batch.schema.json
Normal file
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://schemas.bakery-ia.com/demo/production/batch/v1",
|
||||
"type": "object",
|
||||
"title": "ProductionBatch",
|
||||
"description": "Production batch for demo cloning",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique batch identifier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant owner (replaced during cloning)"
|
||||
},
|
||||
"batch_number": {
|
||||
"type": "string",
|
||||
"pattern": "^BATCH-[0-9]{8}-[A-Z0-9]{6}$",
|
||||
"description": "Unique batch code"
|
||||
},
|
||||
"product_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to inventory.Ingredient (type=FINISHED_PRODUCT)"
|
||||
},
|
||||
"product_name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 255
|
||||
},
|
||||
"recipe_id": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to recipes.Recipe"
|
||||
},
|
||||
"planned_start_time": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 datetime with timezone"
|
||||
},
|
||||
"planned_end_time": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planned_quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0.1,
|
||||
"description": "Quantity in product's unit of measure"
|
||||
},
|
||||
"planned_duration_minutes": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"actual_start_time": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time",
|
||||
"description": "Set when status becomes IN_PROGRESS"
|
||||
},
|
||||
"actual_end_time": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time",
|
||||
"description": "Set when status becomes COMPLETED"
|
||||
},
|
||||
"actual_quantity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"actual_duration_minutes": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["PENDING", "IN_PROGRESS", "COMPLETED", "CANCELLED", "ON_HOLD", "QUALITY_CHECK", "FAILED"],
|
||||
"default": "PENDING"
|
||||
},
|
||||
"priority": {
|
||||
"type": "string",
|
||||
"enum": ["LOW", "MEDIUM", "HIGH", "URGENT"],
|
||||
"default": "MEDIUM"
|
||||
},
|
||||
"current_process_stage": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["mixing", "proofing", "shaping", "baking", "cooling", "packaging", "finishing", null]
|
||||
},
|
||||
"process_stage_history": {
|
||||
"type": ["array", "null"],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"stage": {"type": "string"},
|
||||
"timestamp": {"type": "string", "format": "date-time"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pending_quality_checks": {
|
||||
"type": ["array", "null"],
|
||||
"items": {"type": "string"}
|
||||
},
|
||||
"completed_quality_checks": {
|
||||
"type": ["array", "null"],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"stage": {"type": "string"},
|
||||
"score": {"type": "number"},
|
||||
"timestamp": {"type": "string", "format": "date-time"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"estimated_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"actual_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"labor_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"material_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"overhead_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"yield_percentage": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
},
|
||||
"quality_score": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0,
|
||||
"maximum": 10
|
||||
},
|
||||
"waste_quantity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"defect_quantity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"waste_defect_type": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["burnt", "misshapen", "underproofed", "temperature_issues", "expired", null]
|
||||
},
|
||||
"equipment_used": {
|
||||
"type": ["array", "null"],
|
||||
"items": {"type": "string", "format": "uuid"},
|
||||
"minItems": 1,
|
||||
"description": "Array of Equipment IDs"
|
||||
},
|
||||
"staff_assigned": {
|
||||
"type": ["array", "null"],
|
||||
"items": {"type": "string", "format": "uuid"}
|
||||
},
|
||||
"station_id": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 50
|
||||
},
|
||||
"order_id": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to orders.CustomerOrder"
|
||||
},
|
||||
"forecast_id": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to forecasting.Forecast"
|
||||
},
|
||||
"is_rush_order": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"is_special_recipe": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"is_ai_assisted": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"production_notes": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"quality_notes": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"delay_reason": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 255
|
||||
},
|
||||
"cancellation_reason": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 255
|
||||
},
|
||||
"reasoning_data": {
|
||||
"type": ["object", "null"],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["forecast_demand", "customer_order", "stock_replenishment"]
|
||||
},
|
||||
"parameters": {"type": "object"},
|
||||
"urgency": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"level": {"type": "string"},
|
||||
"ready_by_time": {"type": "string"},
|
||||
"customer_commitment": {"type": "boolean"}
|
||||
}
|
||||
},
|
||||
"metadata": {"type": "object"}
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id", "tenant_id", "batch_number", "product_id", "product_name",
|
||||
"planned_start_time", "planned_end_time", "planned_quantity",
|
||||
"planned_duration_minutes", "status", "priority"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {"status": {"const": "IN_PROGRESS"}}
|
||||
},
|
||||
"then": {
|
||||
"required": ["actual_start_time"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {"status": {"const": "COMPLETED"}}
|
||||
},
|
||||
"then": {
|
||||
"required": ["actual_start_time", "actual_end_time", "actual_quantity"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
169
shared/demo/schemas/production/equipment.schema.json
Normal file
169
shared/demo/schemas/production/equipment.schema.json
Normal file
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://schemas.bakery-ia.com/demo/production/equipment/v1",
|
||||
"type": "object",
|
||||
"title": "Equipment",
|
||||
"description": "Production equipment for demo cloning",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique equipment identifier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant owner (replaced during cloning)"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 255
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["oven", "mixer", "proofer", "freezer", "packaging", "other"]
|
||||
},
|
||||
"model": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"serial_number": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"location": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 255
|
||||
},
|
||||
"manufacturer": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"firmware_version": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 50
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["OPERATIONAL", "MAINTENANCE", "DOWN", "WARNING"],
|
||||
"default": "OPERATIONAL"
|
||||
},
|
||||
"install_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"last_maintenance_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"next_maintenance_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"maintenance_interval_days": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"efficiency_percentage": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
},
|
||||
"uptime_percentage": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
},
|
||||
"energy_usage_kwh": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"power_kw": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"capacity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"weight_kg": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"current_temperature": {
|
||||
"type": ["number", "null"]
|
||||
},
|
||||
"target_temperature": {
|
||||
"type": ["number", "null"]
|
||||
},
|
||||
"iot_enabled": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"iot_protocol": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["rest_api", "opc_ua", "mqtt", "modbus", "custom"]
|
||||
},
|
||||
"iot_endpoint": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 500
|
||||
},
|
||||
"iot_port": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1,
|
||||
"maximum": 65535
|
||||
},
|
||||
"iot_connection_status": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["connected", "disconnected", "error", "unknown"]
|
||||
},
|
||||
"iot_last_connected": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"supports_realtime": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"poll_interval_seconds": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"temperature_zones": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"supports_humidity": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"supports_energy_monitoring": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"supports_remote_control": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"is_active": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"notes": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"created_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id", "tenant_id", "name", "type", "status", "is_active"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
191
shared/demo/schemas/recipes/recipe.schema.json
Normal file
191
shared/demo/schemas/recipes/recipe.schema.json
Normal file
@@ -0,0 +1,191 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://schemas.bakery-ia.com/demo/recipes/recipe/v1",
|
||||
"type": "object",
|
||||
"title": "Recipe",
|
||||
"description": "Recipe for demo cloning",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique recipe identifier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant owner (replaced during cloning)"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 255
|
||||
},
|
||||
"recipe_code": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"default": "1.0"
|
||||
},
|
||||
"finished_product_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to inventory.Ingredient (product_type=finished_product)"
|
||||
},
|
||||
"description": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"category": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"cuisine_type": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"difficulty_level": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 5,
|
||||
"default": 1
|
||||
},
|
||||
"yield_quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0.1
|
||||
},
|
||||
"yield_unit": {
|
||||
"type": "string",
|
||||
"enum": ["g", "kg", "ml", "l", "cups", "tbsp", "tsp", "units", "pieces", "%"]
|
||||
},
|
||||
"prep_time_minutes": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"cook_time_minutes": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"total_time_minutes": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"rest_time_minutes": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"estimated_cost_per_unit": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"last_calculated_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"cost_calculation_date": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"target_margin_percentage": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
},
|
||||
"suggested_selling_price": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"instructions": {
|
||||
"type": ["object", "null"]
|
||||
},
|
||||
"preparation_notes": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"storage_instructions": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"serves_count": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1
|
||||
},
|
||||
"nutritional_info": {
|
||||
"type": ["object", "null"]
|
||||
},
|
||||
"allergen_info": {
|
||||
"type": ["array", "null"],
|
||||
"items": {"type": "string"}
|
||||
},
|
||||
"dietary_tags": {
|
||||
"type": ["array", "null"],
|
||||
"items": {"type": "string"}
|
||||
},
|
||||
"batch_size_multiplier": {
|
||||
"type": "number",
|
||||
"minimum": 0.1,
|
||||
"default": 1.0
|
||||
},
|
||||
"minimum_batch_size": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0.1
|
||||
},
|
||||
"maximum_batch_size": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0.1
|
||||
},
|
||||
"optimal_production_temperature": {
|
||||
"type": ["number", "null"]
|
||||
},
|
||||
"optimal_humidity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
},
|
||||
"quality_check_configuration": {
|
||||
"type": ["object", "null"]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["DRAFT", "ACTIVE", "TESTING", "ARCHIVED", "DISCONTINUED"],
|
||||
"default": "DRAFT"
|
||||
},
|
||||
"is_seasonal": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"season_start_month": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1,
|
||||
"maximum": 12
|
||||
},
|
||||
"season_end_month": {
|
||||
"type": ["integer", "null"],
|
||||
"minimum": 1,
|
||||
"maximum": 12
|
||||
},
|
||||
"is_signature_item": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"created_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
},
|
||||
"created_by": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid"
|
||||
},
|
||||
"updated_by": {
|
||||
"type": ["string", "null"],
|
||||
"format": "uuid"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id", "tenant_id", "name", "finished_product_id", "yield_quantity", "yield_unit",
|
||||
"status", "is_seasonal", "is_signature_item", "batch_size_multiplier"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
100
shared/demo/schemas/recipes/recipe_ingredient.schema.json
Normal file
100
shared/demo/schemas/recipes/recipe_ingredient.schema.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://schemas.bakery-ia.com/demo/recipes/recipe_ingredient/v1",
|
||||
"type": "object",
|
||||
"title": "RecipeIngredient",
|
||||
"description": "Ingredient required for a recipe",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique recipe ingredient identifier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant owner (replaced during cloning)"
|
||||
},
|
||||
"recipe_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Reference to recipes.Recipe"
|
||||
},
|
||||
"ingredient_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Cross-service ref to inventory.Ingredient"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "number",
|
||||
"minimum": 0.001
|
||||
},
|
||||
"unit": {
|
||||
"type": "string",
|
||||
"enum": ["g", "kg", "ml", "l", "cups", "tbsp", "tsp", "units", "pieces", "%"]
|
||||
},
|
||||
"quantity_in_base_unit": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"alternative_quantity": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"alternative_unit": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["g", "kg", "ml", "l", "cups", "tbsp", "tsp", "units", "pieces", "%"]
|
||||
},
|
||||
"preparation_method": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 255
|
||||
},
|
||||
"ingredient_notes": {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"is_optional": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"ingredient_order": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"default": 1
|
||||
},
|
||||
"ingredient_group": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 100
|
||||
},
|
||||
"substitution_options": {
|
||||
"type": ["array", "null"],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ingredient_id": {"type": "string", "format": "uuid"},
|
||||
"name": {"type": "string"},
|
||||
"ratio": {"type": "number"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"substitution_ratio": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0.1
|
||||
},
|
||||
"unit_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"total_cost": {
|
||||
"type": ["number", "null"],
|
||||
"minimum": 0
|
||||
},
|
||||
"cost_updated_at": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id", "tenant_id", "recipe_id", "ingredient_id", "quantity", "unit", "ingredient_order"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
103
shared/demo/schemas/sales/sales_data.schema.json
Normal file
103
shared/demo/schemas/sales/sales_data.schema.json
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "SalesData",
|
||||
"description": "Schema for sales data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"sale_date",
|
||||
"product_id",
|
||||
"quantity_sold",
|
||||
"unit_price",
|
||||
"total_revenue",
|
||||
"sales_channel",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the sales record"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"sale_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Sale date"
|
||||
},
|
||||
"product_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Product identifier"
|
||||
},
|
||||
"quantity_sold": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Quantity sold"
|
||||
},
|
||||
"unit_price": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Unit price in EUR"
|
||||
},
|
||||
"total_revenue": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Total revenue in EUR"
|
||||
},
|
||||
"sales_channel": {
|
||||
"type": "string",
|
||||
"enum": ["IN_STORE", "ONLINE", "WHOLESALE", "ENTERPRISE", "OTHER"],
|
||||
"description": "Sales channel"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes"
|
||||
},
|
||||
"enterprise_sale": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level sale"
|
||||
},
|
||||
"customer_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Customer identifier"
|
||||
},
|
||||
"contract_reference": {
|
||||
"type": "string",
|
||||
"description": "Contract reference"
|
||||
},
|
||||
"delivery_locations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Delivery locations"
|
||||
},
|
||||
"reasoning_data": {
|
||||
"type": "object",
|
||||
"description": "Reasoning data for special sales",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Reasoning type"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"description": "Reasoning parameters"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
183
shared/demo/schemas/suppliers/supplier.schema.json
Normal file
183
shared/demo/schemas/suppliers/supplier.schema.json
Normal file
@@ -0,0 +1,183 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Supplier",
|
||||
"description": "Schema for supplier data in Bakery-IA system",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"tenant_id",
|
||||
"name",
|
||||
"supplier_code",
|
||||
"business_name",
|
||||
"tax_id",
|
||||
"contact_person",
|
||||
"email",
|
||||
"phone",
|
||||
"address",
|
||||
"city",
|
||||
"postal_code",
|
||||
"country",
|
||||
"status",
|
||||
"rating",
|
||||
"payment_terms",
|
||||
"minimum_order_amount",
|
||||
"lead_time_days",
|
||||
"contract_start_date",
|
||||
"contract_end_date",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Unique identifier for the supplier"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Tenant identifier"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 100,
|
||||
"description": "Supplier name"
|
||||
},
|
||||
"supplier_code": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "Supplier code"
|
||||
},
|
||||
"business_name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 100,
|
||||
"description": "Legal business name"
|
||||
},
|
||||
"tax_id": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 20,
|
||||
"description": "Tax identification number"
|
||||
},
|
||||
"contact_person": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 100,
|
||||
"description": "Primary contact person"
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"format": "email",
|
||||
"description": "Contact email"
|
||||
},
|
||||
"phone": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 20,
|
||||
"description": "Contact phone number"
|
||||
},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 200,
|
||||
"description": "Street address"
|
||||
},
|
||||
"city": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "City"
|
||||
},
|
||||
"postal_code": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 10,
|
||||
"description": "Postal code"
|
||||
},
|
||||
"country": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 50,
|
||||
"description": "Country"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["ACTIVE", "INACTIVE", "PENDING", "SUSPENDED"],
|
||||
"description": "Supplier status"
|
||||
},
|
||||
"rating": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 5,
|
||||
"description": "Supplier rating (0-5)"
|
||||
},
|
||||
"payment_terms": {
|
||||
"type": "string",
|
||||
"enum": ["7_DAYS", "15_DAYS", "30_DAYS", "60_DAYS", "90_DAYS"],
|
||||
"description": "Payment terms"
|
||||
},
|
||||
"minimum_order_amount": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Minimum order amount in EUR"
|
||||
},
|
||||
"lead_time_days": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Lead time in days"
|
||||
},
|
||||
"contract_start_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Contract start date"
|
||||
},
|
||||
"contract_end_date": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Contract end date"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Creation timestamp"
|
||||
},
|
||||
"specialties": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Product specialties"
|
||||
},
|
||||
"delivery_areas": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Delivery areas"
|
||||
},
|
||||
"enterprise_contract": {
|
||||
"type": "boolean",
|
||||
"description": "Enterprise-level contract"
|
||||
},
|
||||
"contract_type": {
|
||||
"type": "string",
|
||||
"description": "Type of contract"
|
||||
},
|
||||
"annual_volume_commitment": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Annual volume commitment"
|
||||
},
|
||||
"preferred_supplier": {
|
||||
"type": "boolean",
|
||||
"description": "Preferred supplier status"
|
||||
},
|
||||
"organic_certified": {
|
||||
"type": "boolean",
|
||||
"description": "Organic certification"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
Reference in New Issue
Block a user