[FEAT/#361] 백오피스 관리자, 제휴 관리 기능#363
Conversation
|
혹시 PR 내용 좀 작성 부탁드려도 될까용? @eeeeeaaan ㄴ네 |
There was a problem hiding this comment.
굳이 이렇게 따로 만든 이유는 기존에 제휴 생성은 권한으로 막혀있어서 backoffice에서는 따로 권한이나 인증 절차 없이 가능하게 하려고
| public void deleteAdmin(Long adminId) { | ||
| Member member = memberRepository.findById(adminId) | ||
| .orElseThrow(() -> new CustomAuthException(ErrorStatus.NO_SUCH_MEMBER)); | ||
| memberRepository.delete(member); |
There was a problem hiding this comment.
제휴가 있는 학생회 계정을 삭제하려고 하면 cascade가 안 걸려 있어서 500 터질 것 같아여
There was a problem hiding this comment.
음.. 그러면 임의의 학생회 계정을 삭제하는 기능을 넣는게 맞을까요? 제휴 뿐만 아니라 채팅방 등등 여러 테이블에서 adminId 를 가지고 있는데 이것들도 역시 삭제시에 문제가 될 것 같아서요. (아니면 softDelete 등의 대안도 있다고 생각하긴 한데 무슨 의미가 있는지는... 잘 모르겠음)
| return WritePartnershipResponseDTO.of(paper, contentsWithGoods, goodsBatches); | ||
| } | ||
|
|
||
| private List<WritePartnershipResponseDTO> buildPartnershipDTOs(List<Paper> papers) { |
There was a problem hiding this comment.
buildPartnershipDTOs 메서드가 PartnershipServiceImpl, BackofficePartnershipServiceImpl에도 똑같이 있어서 유틸화해서 쓰면 좋을 것 같긴 해요 근데 우리 이런거 유틸화를 했었나..?
| private final BackofficeAdminService backofficeAdminService; | ||
|
|
||
| @Operation(summary = "모든 학생회 계정 조회 API", description = "시스템에 등록된 모든 학생회(Admin) 계정 목록을 조회합니다.") | ||
| @GetMapping |
| List<Paper> findByPartner_IdAndIsActivated(Long partnerId, ActivationStatus status, Sort sort); | ||
| Page<Paper> findByPartner_IdAndIsActivated(Long partnerId, ActivationStatus status, Pageable pageable); | ||
| long countByStore_Id(Long storeId); | ||
| Page<Paper> findByStore_IdAndIsActivated(Long storeId, ActivationStatus status, Pageable pageable); |
There was a problem hiding this comment.
여기서 파라미터는 ActivationStatus인데, 메소드에는 IsActivated로 나타내주고 있어서 메소드에도 ActivationStatus로 넣어주는건 어떨까요?
| .orElseThrow(() -> new CustomAuthException(ErrorStatus.NO_SUCH_MEMBER)); | ||
| Store store = storeRepository.findById(req.storeId()) | ||
| .orElseThrow(() -> new CustomAuthException(ErrorStatus.NO_SUCH_MEMBER)); // 가게 없을 시 예외 | ||
|
|
There was a problem hiding this comment.
여기서는 CustomAuthException보다는 DatabaseException이나 다른 커스텀 예외 클래스를 사용하는 게 좋아보입니다
| Paper paper = paperRepository.findById(paperId) | ||
| .orElseThrow(() -> new CustomAuthException(ErrorStatus.NO_SUCH_MEMBER)); | ||
|
|
||
| paper.setIsActivated(ActivationStatus.ACTIVE); |
There was a problem hiding this comment.
여기서 상태 전이 순서를 보장하기 위해서 승인된 계약서를 다시 승인시에 예외를 발생시키는 것이 좋아보입니다
#️⃣연관된 이슈
📝작업 내용
🔎코드 설명
💬고민사항 및 리뷰 요구사항
비고