Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] 캐러셀 수정 로직에서 기존 CarouselNumber와 새롭게 추가하려는 CarouselNumber가 같은 값을 가질 경우 삭제 대상에서 제외되는 문제 #219

Closed
1 task done
hoonyworld opened this issue Sep 30, 2024 · 0 comments · Fixed by #220
Assignees
Labels

Comments

@hoonyworld
Copy link
Member

hoonyworld commented Sep 30, 2024

Bug/Fix Issue 📌

  • 기존에 있던 CarouselNumber와 새롭게 추가하려는 CarouselNumber가 같은 값을 가지고 있는 경우, 둘 다 requestCarouselNumbers에 포함되기 때문에 삭제 대상에서 제외되는 문제가 발견되었습니다.
    • (ex. 기존의 two 캐러셀과 새롭게 추가하려는 two 캐러셀의 CarouselNumber가 동일하다면, 기존의 캐러셀이 삭제되지 않고 새로운 캐러셀도 추가되는 상황이 발생)

Todo ✔️

  • 기존 캐러셀과 요청된 캐러셀이 동일한 CarouselNumber가 있으면 기존 캐러셀을 먼저 삭제한 후, 새로운 캐러셀을 추가하도록 수정
@hoonyworld hoonyworld self-assigned this Sep 30, 2024
hoonyworld added a commit that referenced this issue Sep 30, 2024
- Promotion ID가 다른 중복된 캐러셀 번호만 삭제하도록 수정
- 삭제할 캐러셀 번호와 중복된 캐러셀 번호를 분리하여 처리
- 중복된 캐러셀 번호를 처리하는 로직을 메서드로 분리하여 가독성 향상
- Promotion 수정 및 생성 요청을 명확하게 분리하여 처리
hoonyworld added a commit that referenced this issue Sep 30, 2024
hoonyworld added a commit that referenced this issue Sep 30, 2024
- `deleteByCarouselNumbers` 메서드 변: 여러 캐러셀 번호에 해당하는 프로모션을 한 경에 삭제하도록 로직 변경
- `findByCarouselNumber` 메서드 추가: 캐러셀 번호로 프로모션을 조회하는 기능 구현
- JPA 쿼리 최적화를 위해 `@Modifying` 및 `@Transactional` 어노테이션 추가
hoonyworld added a commit that referenced this issue Sep 30, 2024
* [#219] fix(AdminFacade): 중복된 캐러셀 번호 처리 및 삭제 로직 수정

- Promotion ID가 다른 중복된 캐러셀 번호만 삭제하도록 수정
- 삭제할 캐러셀 번호와 중복된 캐러셀 번호를 분리하여 처리
- 중복된 캐러셀 번호를 처리하는 로직을 메서드로 분리하여 가독성 향상
- Promotion 수정 및 생성 요청을 명확하게 분리하여 처리

* [#219] feat(AdminService): 중복된 캐러셀 번호 처리 및 프로모션 삭제 로직 추가

* [#219] refactor(AdminUseCase): 메서드 시그니처 변경

* [#219] refactor(PromotionService): 캐러셀넘버로 Promotion 객체를 찾는 메서드 구현 및 캐러셀 넘버로 삭제 시 리스트 형태로 주도록 변경

* [#219] refactor(PromotionUseCase): 메서드 시그니처 변경 및 캐러셀 넘버로 Promotion 객체를 조회하는 메서드 선언

* [#219] refactor(PromotionRepository): 캐러셀 번호 기반 프로모션 삭제 로직 변경 및 조회 기능 추가

- `deleteByCarouselNumbers` 메서드 변: 여러 캐러셀 번호에 해당하는 프로모션을 한 경에 삭제하도록 로직 변경
- `findByCarouselNumber` 메서드 추가: 캐러셀 번호로 프로모션을 조회하는 기능 구현
- JPA 쿼리 최적화를 위해 `@Modifying` 및 `@Transactional` 어노테이션 추가
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant