-
Notifications
You must be signed in to change notification settings - Fork 2
[BE] [FEAT] 복식부기 기반 포인트 원장 시스템 도입 #200
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
Merged
The head ref may contain hidden characters: "20260122_#191_\uBCF5\uC2DD\uBD80\uAE30_\uAE30\uBC18_\uD3EC\uC778\uD2B8_\uC6D0\uC7A5_\uC2DC\uC2A4\uD15C_\uB3C4\uC785"
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
3f6ad35
[BE] [FIX] 라운드 통계 업데이트 벌크 연산 시 영속성 컨텍스트 초기화 옵션 제거
Yooonjeong d5d0efc
[BE] [FEAT] 포인트 복식부기 원장 DB 스키마 정의
Yooonjeong 2eb1c27
[BE] [FEAT] 차/대변 분개 항목 정의 record 추가
Yooonjeong 0752d71
[BE] [FEAT] Account, Transaction, LedgerEntry 레포지토리 정의
Yooonjeong e98479e
[BE] [FEAT] 복식부기 관련 ErrorCode 정의
Yooonjeong 6fc997a
[BE] [FEAT] 계정 조회 및 생성 로직 구현
Yooonjeong f3c9040
[BE] [FEAT] 포인트 거래 및 분개 생성 메서드 정의
Yooonjeong f454695
[BE] [FEAT] 마이그레이션을 위한 계정 생성 전 사용자 조회 쿼리 작성
Yooonjeong fbe2489
[BE] [FEAT] 계정 생성 전 사용자 조회 메서드 구현
Yooonjeong 3a9880a
[BE] [FEAT] 계정 생성 및 포인트 마이그레이션 로직 구현
Yooonjeong 68bde32
[BE] [FEAT] 회원가입 시 계정 생성 및 기본 포인트 제공 로직 구현
Yooonjeong aac0bc9
[BE] [FEAT] 베팅 생성 시 포인트 차감 복식부기 포인트 서비스 로직으로 변경
Yooonjeong 970d17e
[BE] [FEAT] 베팅 정산 로직 복식부기 서비스로 변경 및 보상 잔여금 트랜잭션 구현
Yooonjeong dcdc83b
[BE] [FEAT] 베팅 취소 복식부기 도입 및 불필요한 saveAndFlush 제거
Yooonjeong 4dc1d64
[BE] [FEAT] LedgerEntry에도 BaseEntity 상속 추가
Yooonjeong 7667260
[BE] [FEAT] 분개 레코드에 EntryType(차변/대변) 포함
Yooonjeong e358650
[BE] [FEAT] 분개 생성 시 EntryType 필드 추가
Yooonjeong f2e067d
[BE] [FEAT] 포인트 내역 조회용 내부 DTO 정의
Yooonjeong 86c2b38
[BE] [FEAT] PointTransaction을 Fetch Join으로 함께 조회하는 전체 포인트 내역 조회 쿼리 구현
Yooonjeong 38c661e
[BE] [FEAT] 리더보드 제외한 포인트 내역 조회 dto 정의
Yooonjeong 9ad8f8b
[BE] [FEAT] 기존 서비스 삭제 및 복식부기 기반 포인트 기록 조회 메서드 추가
Yooonjeong 4541d57
[BE] [FEAT] 리더보드 조회 api 삭제 및 포인트 내역 조회 api 수정
Yooonjeong 4ed8f5b
[BE] [REFACTOR] 복식부기 시스템 도입에 따른 기존 포인트 테스트 코드 제거
Yooonjeong 7ff5561
[BE] [REFACTOR] 베팅, 계정, 포인트 서비스 로직 로깅 추가
Yooonjeong 39df16c
[BE] [FEAT] 회원가입 메서드에 @OptimisticRetry 어노테이션 추가
Yooonjeong 93aa12b
[BE] [FEAT] 통계 직접 업데이트 시 flushAutomatically = true 옵션 추가 및 주석 업데이트
Yooonjeong 47ac3d1
[BE] [FIX] 베팅 보상 트랜잭션에서 사용자 계정 debit으로 변경
Yooonjeong 7e68cf2
[BE] [FIX] 복식부기 관련 Entity nullable false 속성 추가
Yooonjeong 74e3624
[BE] [REFACTOR] balance 컬럼 primitive 타입으로 변경 및 null 체크 추가
Yooonjeong 835a3b1
[BE] [FEAT] OAUTH 회원가입 시에도 계정 생성 및 포인트 지급 처리 추가
Yooonjeong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
37 changes: 37 additions & 0 deletions
37
backend/src/main/java/org/sejongisc/backend/point/dto/AccountEntry.java
This file contains hidden or 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,37 @@ | ||
| package org.sejongisc.backend.point.dto; | ||
|
|
||
| import org.sejongisc.backend.common.exception.CustomException; | ||
| import org.sejongisc.backend.common.exception.ErrorCode; | ||
| import org.sejongisc.backend.point.entity.Account; | ||
| import org.sejongisc.backend.point.entity.EntryType; | ||
|
|
||
| public record AccountEntry( | ||
| Account account, | ||
| Long amount, | ||
| EntryType entryType | ||
| ) { | ||
| public AccountEntry { | ||
| if (account == null) { | ||
| throw new CustomException(ErrorCode.ACCOUNT_REQUIRED); | ||
| } | ||
| if (amount == null || amount == 0) { | ||
| throw new CustomException(ErrorCode.INVALID_POINT_AMOUNT); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * 차변 항목 생성 | ||
| * 해당 계정에 잔액이 증가할 때 사용 | ||
| */ | ||
| public static AccountEntry debit(Account account, Long amount) { | ||
| return new AccountEntry(account, Math.abs(amount), EntryType.DEBIT); | ||
| } | ||
|
|
||
| /** | ||
| * 대변 항목 생성 | ||
| * 해당 계정에 잔액이 감소할 때 사용 | ||
| */ | ||
| public static AccountEntry credit(Account account, Long amount) { | ||
| return new AccountEntry(account, -Math.abs(amount), EntryType.CREDIT); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.