aiteamutils 0.2.109__py3-none-any.whl → 0.2.111__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aiteamutils/validators.py CHANGED
@@ -193,9 +193,11 @@ class Validator:
193
193
  @staticmethod
194
194
  def validate_date(value: Any, field_name: str = "date") -> Optional[date]:
195
195
  """날짜 형식 검증을 수행하는 메서드."""
196
- if value is None or isinstance(value, date):
196
+ if value is None:
197
+ return None
198
+ if isinstance(value, date):
197
199
  return value
198
- if value == "":
200
+ if value == "" or not value:
199
201
  return None
200
202
  try:
201
203
  return datetime.strptime(str(value), '%Y-%m-%d').date()
@@ -217,7 +219,17 @@ def date_validator(*field_names: str):
217
219
  @field_validator(field_name, mode='before')
218
220
  @classmethod
219
221
  def validate(cls, value: Any, info: Any) -> Any:
220
- return Validator.validate_date(value, field_name)
222
+ try:
223
+ return Validator.validate_date(value, field_name)
224
+ except CustomException as e:
225
+ raise e
226
+ except Exception as e:
227
+ raise CustomException(
228
+ error_code=ErrorCode.INVALID_DATE_FORMAT,
229
+ detail=f"{field_name}|{value}",
230
+ source_function=f"date_validator.{field_name}",
231
+ original_error=str(e)
232
+ )
221
233
  setattr(cls, f'validate_{field_name}', validate)
222
234
  return cls
223
235
  return decorator
aiteamutils/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """버전 정보"""
2
- __version__ = "0.2.109"
2
+ __version__ = "0.2.111"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.109
3
+ Version: 0.2.111
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -8,8 +8,8 @@ aiteamutils/database.py,sha256=SmE6JiyQoqCNlrV4AVxrp1tsrNryyZSQWJM0dHN4MQA,19696
8
8
  aiteamutils/enums.py,sha256=7WLqlcJqQWtETAga2WAxNp3dJTQIAd2TW-4WzkoHHa8,2498
9
9
  aiteamutils/exceptions.py,sha256=pgf3ersezObyl17wAO3I2fb8m9t2OzWDX1mSjwAWm2Y,16035
10
10
  aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
11
- aiteamutils/validators.py,sha256=4H65pmH4SeaGY0MlIYmnzNC_RWRIAF4B6kOtxD1hhNw,8940
12
- aiteamutils/version.py,sha256=M0lPuKKEr3BkcMhw_Z_nK2KV8aOLBpsJFlxGcoaEUxg,43
13
- aiteamutils-0.2.109.dist-info/METADATA,sha256=Gv8cjx0BTr5Q5WntI1GP03IgNzhZZjjBqGwqxBYR5SY,1719
14
- aiteamutils-0.2.109.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- aiteamutils-0.2.109.dist-info/RECORD,,
11
+ aiteamutils/validators.py,sha256=Ogx-YhE7qhTr5L6TKLMaGOdJn27LmYD1ejfeNrxyPaw,9428
12
+ aiteamutils/version.py,sha256=D9Ww_H4RqunQWUFEweffo1g8IsES8azAURE_irC2ro0,43
13
+ aiteamutils-0.2.111.dist-info/METADATA,sha256=XLkSDKEXB09JWrjh6a3fYLPC_6G9PuAjORB5p7_MVpc,1719
14
+ aiteamutils-0.2.111.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ aiteamutils-0.2.111.dist-info/RECORD,,