[fix] negodata/backend: 시각 컬럼 timestamptz 전환 + naive 변환 제거

- models.py: created_at/updated_at/last_accessed_at/start_time/end_time/bid_at
  DateTime → DateTime(timezone=True)
- quotation_service: tz-aware 입력을 naive 로 깎던 _naive_utc 제거(컬럼이 tz-aware라 불필요),
  start_time/end_time 직접 사용. negosium_db 는 UTC 고정.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 4.8 committed 2026-06-26 15:30:33 +09:00
1 parent aed8364b40
commit 0c6a002e29
2 files changed
+9 -18

No files matched your search

+2 -11
View File
@@ -68,15 +68,6 @@ class QuotationService:
return int(int(price) / (1 + margin))
return int(price)
@staticmethod
def _naive_utc(dt):
"""DB 컬럼이 naive(TIMESTAMP WITHOUT TIME ZONE)라, tz-aware 입력(프론트 toISOString 등)은 UTC naive 로 변환."""
if dt is None:
return dt
if getattr(dt, "tzinfo", None) is not None:
return dt.astimezone(timezone.utc).replace(tzinfo=None)
return dt
@staticmethod
def _gen_number() -> str:
"""견적번호 자동 생성(미지정 시). EST-YYYYMM-XXXX."""
@@ -156,8 +147,8 @@ class QuotationService:
type_=req.type,
status=req.status or QuotationStatus.CREATED.value,
round_=req.round or 1,
start_time=self._naive_utc(req.start_time or GTime.UTC()),
end_time=self._naive_utc(req.end_time),
start_time=req.start_time or GTime.UTC(),
end_time=req.end_time,
manager_name=req.manager_name,
manager_email=req.manager_email,
manager_contact_number=req.manager_contact_number,