katana_public_api_client.domain.base¶
katana_public_api_client.domain.base
¶
Base domain model for Katana entities.
This module provides the foundation for Pydantic domain models that represent business entities from the Katana Manufacturing ERP system.
Domain models are separate from the generated API request/response models and are optimized for: - ETL and data processing - Business logic - Data validation - JSON schema generation - Clean, ergonomic APIs
Classes¶
KatanaBaseModel
¶
Bases: BaseModel
Base class for all Pydantic domain models.
Provides: - Immutability by default (frozen=True) - Automatic validation - JSON schema generation - Easy serialization for ETL - Common timestamp fields
Example
Functions¶
model_dump_for_etl()
¶
Export to ETL-friendly format.
Removes None values and uses field aliases for cleaner output.
Returns:
Example
Source code in katana_public_api_client/domain/base.py
to_dict_with_computed()
¶
Export including computed fields.
Unlike model_dump(), this includes @computed_field properties.
Returns:
Source code in katana_public_api_client/domain/base.py
to_warehouse_json()
¶
Export as JSON for data warehouse.
Returns:
-
str–JSON string with all non-None fields