katana_public_api_client.domain.service¶
katana_public_api_client.domain.service
¶
Domain model for Service entities.
This module provides a Pydantic model representing a Service (external service) optimized for ETL, data processing, and business logic.
Classes¶
KatanaService
¶
Bases: KatanaBaseModel
Domain model for a Service.
A Service represents an external service that can be used as part of manufacturing operations or business processes. This is a Pydantic model optimized for: - ETL and data processing - Business logic - Data validation - JSON schema generation
Unlike the generated attrs model, this model: - Has no Unset sentinel values - Provides ETL-friendly methods - Is immutable by default - Clean Optional types
Example
service = KatanaService(
id=1,
name="External Assembly Service",
type="service",
uom="pcs",
category_name="Assembly",
is_sellable=True,
)
# Business methods available
print(service.get_display_name()) # "External Assembly Service"
# ETL export
csv_row = service.to_csv_row()
schema = KatanaService.model_json_schema()
Functions¶
get_display_name()
¶
Get formatted display name.
Returns:
-
str–Service name, or "Unnamed Service {id}" if no name
Example
Source code in katana_public_api_client/domain/service.py
matches_search(query)
¶
Check if service matches search query.
Searches across: - Service name - Category name
Parameters:
-
query(str) –Search query string (case-insensitive)
Returns:
-
bool–True if service matches query
Example
Source code in katana_public_api_client/domain/service.py
to_csv_row()
¶
Export as CSV-friendly row.
Returns: