Files
invoice-master-poc-v2/packages/backend/backend/domain/utils.py
Yaojia Wang c2c8f2dd04 WIP
2026-02-03 22:29:53 +01:00

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())