-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 배포 파이프라인 이미지 빌드 버전 추가 * refactor: create_target_amount() 리팩토링 * rename: recent_target_amount_search_service -> target_amount_search_service * refactor: get_target_amount_and_total_spending() * refactor: get_target_amounts_and_total_spendings() * refactor: update_target_amount 리팩토링 * refactor: target_amount_delete_service() 리팩토링 * style: 불필요한 transactional 어노테이션 제거 * refactor: 월별 총 지출 내역 조회 메서드 분리 * refactor: 지출 조회, 지출 목표 금액 조회 서비스 로직 분리 * refactor: 목표금액&월별 지출 내역 리스트 조회 메서드 분리 * fix: target_amount_mapper start_at 사용자 회원가입 일자 -> 가장 오래된 목표 금액 데이터 기반으로 수정 * docs: 목표금액 리스트 조회 스웨거 문서 요약 수정 * refactor: create_spending 리팩토링 * fix: spending_service read_spendings 반환 타입 list에서 optional 제거 * refactor: spending_search_service 관련 메서드 분리 * fix: spending_repository find_by_year_and_month() 반환값 optional 제거 * refactor: spending_update_service 리팩토링 * refactor: spending update & delete 분리 * test: spending_update_service_test 수정
- Loading branch information
1 parent
a69fc70
commit 9b69bd4
Showing
10 changed files
with
79 additions
and
57 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...ernal-api/src/main/java/kr/co/pennyway/api/apis/ledger/service/SpendingDeleteService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package kr.co.pennyway.api.apis.ledger.service; | ||
|
||
import kr.co.pennyway.domain.domains.spending.domain.Spending; | ||
import kr.co.pennyway.domain.domains.spending.exception.SpendingErrorCode; | ||
import kr.co.pennyway.domain.domains.spending.exception.SpendingErrorException; | ||
import kr.co.pennyway.domain.domains.spending.service.SpendingService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@Service | ||
@RequiredArgsConstructor | ||
public class SpendingDeleteService { | ||
private final SpendingService spendingService; | ||
|
||
@Transactional | ||
public void deleteSpending(Long spendingId) { | ||
Spending spending = spendingService.readSpending(spendingId) | ||
.orElseThrow(() -> new SpendingErrorException(SpendingErrorCode.NOT_FOUND_SPENDING)); | ||
|
||
spendingService.deleteSpending(spending); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters