[feat] solution: 미니 블로그·이용후기·예약요청 추가, /s/stay 목업·발행 사이트 UI 다수 수정

인앱 미니 블로그(AI 자동 포스트, 이메일 승인)·이용후기(즉시 게시)·예약 요청(메일 발송)을
새로 붙였고, 병행해서 /s/stay 목업과 발행 사이트 공통 렌더러(UnitsSection·FestivalSection·
LocalGuideSection·WeatherSection 등)의 UI 버그를 다수 고쳤다. 범위가 넓지만 한 주 분량
작업을 한 커밋으로 묶어 달라는 요청에 따라 하나로 묶는다.

- solution/backend: post/review/booking_request 라우터·서비스·CRUD 추가, 스케줄러에
  블로그 초안 생성(새벽 4:10)·발송(아침 9:00) cron 등록, 마이그레이션 4건 추가
- solution/frontend, admin/frontend: 생성된 API 클라이언트 갱신, 리뷰 모더레이션·
  블로그 글 관리 페이지 추가
- solution/site/src: 객실 상세+실시간예약(날짜선택·연락처 폼)을 모달로 통합, 축제·
  주변안내 카드 클릭 시 모달 전환, 후기 목록 카드 UI, 공용 Modal 컴포넌트 신설,
  날씨 문구 동기화 버그 수정(하늘줄·기온줄 한 타이머로), 시설·편의 가능/불가 아이콘
  색상 하이라이트, 헤더 메뉴 순서를 실제 섹션 순서에 맞춤, 하단 탭바 아이콘 정렬 버그
  (line-height) 수정, 추천일정 점선 연결+데스크톱 자동펼침/모바일 축소, 채널 라벨에
  크롤링 원문("NOL")이 새던 것을 bookingLabel() 로 교체
- solution/site/scripts/mockup: /s/stay 패치 스크립트·주입 CSS·JS 다수 수정, stay4~6
  빌드 스크립트 추가(다른 세션 작업)

테스트: solution/site `npx tsc --noEmit` 통과, `npx vitest run` 93 passed,
solution/backend `pytest tests/test_booking_request.py` 6 passed(로컬 DB 대상).
예약 요청 메일은 실제 발송까지 확인(place 66894a1b 소유자 이메일 누락을 DB에서 보정).
This commit is contained in:
minaChoi committed 2026-09-18 09:03:18 +09:00
1 parent 29af37f158
commit 872d00f3c4
338 files changed
+74988 -9283

No files matched your search

+42 -2
View File
@@ -23,7 +23,7 @@ from sqlalchemy import or_, select
from common.category_schema import get_schema
from common.database.db_session_manager import DB_SESSION_MNG
from common.database.model.models import (
place_facts, place_faqs, area_contents, place_photos, place_area_refs, place_songs, place_units,
place_facts, place_faqs, area_contents, place_photos, place_area_refs, place_posts, place_reviews, place_songs, place_units,
site_sections, sites,
)
from common.enums import (
@@ -36,6 +36,8 @@ from common.enums import (
LocalSource,
MediaStatus,
PlaceCategory,
PostStatus,
ReviewStatus,
SongStatus,
)
from common.logger import LOG
@@ -101,6 +103,24 @@ async def build_snapshot(place) -> dict:
).order_by(place_songs.created_at.desc()).limit(1)
)
# 미니 블로그 — 사장님이 승인한 글과 이미 게재된 글. 승인분은 이번 굽기에 처음 실린다.
post_rows = await _select(
select(place_posts).where(
place_posts.place_id == pid,
place_posts.deleted == False, # noqa: E712
place_posts.status.in_((PostStatus.APPROVED.value, PostStatus.PUBLISHED.value)),
).order_by(place_posts.created_at.desc()).limit(200)
)
# 이용 후기 — 검수를 통과한 것만. 대기·반려는 발행본에 나가지 않는다.
review_rows = await _select(
select(place_reviews).where(
place_reviews.place_id == pid,
place_reviews.deleted == False, # noqa: E712
place_reviews.status == ReviewStatus.PUBLISHED.value,
).order_by(place_reviews.published_at.desc()).limit(200)
)
local_rows = await _local_contents(place)
snapshot = {
@@ -188,11 +208,31 @@ async def build_snapshot(place) -> dict:
for r in song_rows
if (r.file_name or "").strip()
],
# ★ 본문과 날짜만 싣는다. 토큰·상태는 운영 값이라 발행본에 나가면 안 된다.
"posts": [
{
"post_id": str(r.post_id),
"body": r.body,
"topic_kind": int(r.topic_kind),
"published_at": (r.published_at or r.approved_at or r.created_at).isoformat(),
}
for r in post_rows
],
# ★ 손님이 적은 표시 이름만 싣는다. IP 해시·상태는 운영 값이라 발행본에 나가면 안 된다.
"reviews": [
{
"review_id": str(r.review_id),
"body": r.body,
"nickname": r.nickname or "",
"published_at": (r.published_at or r.created_at).isoformat(),
}
for r in review_rows
],
}
LOG.i(
f"[snapshot] place={pid} fact {len(snapshot['facts'])} · 객실 {len(snapshot['units'])} · "
f"FAQ {len(snapshot['faqs'])} · 사진 {len(snapshot['media'])} · "
f"지역 {len(snapshot['local']['contents'])} · 노래 {len(snapshot['songs'])}"
f"지역 {len(snapshot['local']['contents'])} · 노래 {len(snapshot['songs'])} · 글 {len(snapshot['posts'])} · 후기 {len(snapshot['reviews'])}"
)
return snapshot