docs(standards): add reusable Tier-B template scaffolds (pipeline family, shared loader/registry, converters, scripts)
This commit is contained in:
18
standards/src/templates/app/domain/item/ports/converters.py
Normal file
18
standards/src/templates/app/domain/item/ports/converters.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""# Summary
|
||||
|
||||
Optional converters for the item slice — pure functions mapping between domain
|
||||
types. Add a converter here when a service must reshape data; keep it pure.
|
||||
"""
|
||||
from domain.item.models import Item
|
||||
|
||||
|
||||
def to_item(data: dict) -> Item:
|
||||
"""Build an :class:`Item` from a raw mapping.
|
||||
|
||||
Args:
|
||||
data (dict): Field mapping matching the item model.
|
||||
|
||||
Returns:
|
||||
Item: The constructed item model.
|
||||
"""
|
||||
return Item(**data)
|
||||
Reference in New Issue
Block a user