feat(board,ecommerce,pay,verification,templates,core): 문의 답변 사슬·답글 삭제 정책·검증 계약 + 실패 사유 표면화 전수
공개 (답변 중복 등록)/(문의 삭제 시 답변 잔존) 수정과 동형 결함 전수 해소.
- 문의 답변 단일성: 1차(피벗 is_answered) + 2차(게시판 리스너 duplicate 마커) 이중 방어,
경합 경로에서도 사유(reply_already_exists 422)가 보존되도록 훅 반환 계약 확장
- 질문·답변·피벗 생명주기 대칭: 삭제/복원/영구삭제 훅 연동 + 고아 데이터 백필 업그레이드 스텝
- 게시판별 답글 삭제 정책(cascade/block) 신설, 정렬 화이트리스트·per_page 게이트
(전량 조회 소비처 200/999 를 수용하는 상한 999 — 조였다가 관리자 화면 2곳 422 회귀 즉시 정정)
- 결제/본인인증 플러그인 검증 계약: FormRequest 15종 승격 + 컨트롤러 catch 정합.
거래 조회 tid 상한은 저장 컬럼(varchar 100) 기준 — 해외 CBT TID(40자) 수용
- onError 토스트 고정 문구 전수 해소(67건/50파일/15확장) — 서버 실패 사유를 그대로 표면화,
change-password 오변수(response→error) 교정
- 코어 플러그인 설정 검증 안내의 항목 표시명이 스키마 라벨(ko/en) 폴백에 덮여 요청 로케일
(ja) 라벨을 잃던 회귀 정정 — 번역 등록이 있으면 그것을 우선 (7.0.7 미출시 기능 자체 결함)
- 사전 결함 정리(Icon 등가표 27·darkmode 2·validated 통일), API 문서·CHANGELOG·ja 팩 동기
- develop(60652fdc0) 리베이스: getTable 정비와 병합 — 양측 의도 보존 (충돌 18파일)
This commit is contained in:
1 parent
60652fdc07
commit
3ebbda5d86
236 files changed
+6324
-437
No files matched your search
@@ -418,6 +418,60 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 게시글의 살아있는 첨부를 cascade 로 일괄 소프트 삭제합니다.
|
||||
*
|
||||
* 답글 트리 연쇄 삭제(softDeleteCascadeByParentId)로 지워지는 자손 게시글들의
|
||||
* 첨부 정리용입니다. 단건 softDeleteByPostId 와 동일한 쿼리를 whereIn 으로 확장했습니다.
|
||||
* 물리 파일은 보존하며 deleted_at 마킹만 수행합니다. (복원 가능성 유지)
|
||||
*
|
||||
* @param string $slug 게시판 슬러그
|
||||
* @param array<int> $postIds 게시글 ID 배열
|
||||
* @return int 삭제된 첨부 수
|
||||
*/
|
||||
public function softDeleteByPostIds(string $slug, array $postIds): int
|
||||
{
|
||||
if ($postIds === []) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$board = Board::where('slug', $slug)->first();
|
||||
|
||||
return Attachment::where('board_id', $board?->id)
|
||||
->whereIn('post_id', $postIds)
|
||||
->update([
|
||||
'trigger_type' => TriggerType::Cascade->value,
|
||||
'deleted_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 게시글의 cascade 로 지워진 첨부만 일괄 복원합니다.
|
||||
*
|
||||
* 답글 트리 연쇄 복원(restoreCascadedByParentId)으로 되살아난 자손 게시글들의
|
||||
* 첨부 복원용입니다. 사용자가 직접 지운 첨부(trigger_type='user')는 유지됩니다.
|
||||
*
|
||||
* @param string $slug 게시판 슬러그
|
||||
* @param array<int> $postIds 게시글 ID 배열
|
||||
* @return int 복원된 첨부 수
|
||||
*/
|
||||
public function restoreCascadedByPostIds(string $slug, array $postIds): int
|
||||
{
|
||||
if ($postIds === []) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$board = Board::where('slug', $slug)->first();
|
||||
|
||||
return Attachment::onlyTrashed()
|
||||
->where('board_id', $board?->id)
|
||||
->whereIn('post_id', $postIds)
|
||||
->where('trigger_type', TriggerType::Cascade->value)
|
||||
->update([
|
||||
'deleted_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 ID 기준으로 첨부파일을 일괄 영구 삭제합니다.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user