24 lines
487 B
Python
24 lines
487 B
Python
"""
|
|
Domain Layer Utilities
|
|
|
|
Shared helper functions for domain layer classes.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
|
|
def has_value(value: str | None) -> bool:
|
|
"""
|
|
Check if a field value is present and non-empty.
|
|
|
|
Args:
|
|
value: Field value to check
|
|
|
|
Returns:
|
|
True if value is a non-empty, non-whitespace string
|
|
"""
|
|
if value is None:
|
|
return False
|
|
if not isinstance(value, str):
|
|
return bool(value)
|
|
return bool(value.strip())
|