Repository navigation
[Feat/#166] 학생회비 납부 API 개편 #167
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
Open
xeoxxn
wants to merge
17
commits into
main
Choose a base branch
from
feat/#166-fee-payment-revision
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+899
−361
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f77f80a
feat: 학점이수현황 캡처 파일 카테고리와 키 조회 추가
xeoxxn fc3f1d7
feat: 학생회비 납부 요청을 이력으로 쌓고 사용자·관리자 API를 개편한다
xeoxxn 0b34f7f
feat: 운영진 처리로 납부 여부가 바뀌면 아웃박스에 기록
xeoxxn 3d4c93d
refactor: 회비 요청 검증을 Bean Validation으로 옮긴다
xeoxxn 59e1fff
refactor: 회비 메서드 이름을 컨벤션에 맞춘다
xeoxxn c7e81f8
refactor: 회비 계좌 설정을 도메인 VO로 합친다
xeoxxn b673e59
refactor: 남은 학기 수와 송금 안내를 회비 도메인 VO로 옮긴다
xeoxxn 681362f
refactor: 회비 상태 판단과 안내 문구 검증을 도메인으로 모은다
xeoxxn d556c78
refactor: 안 쓰는 회원별 최신 요청 조회를 지우고 검증 메서드 이름을 맞춘다
xeoxxn a1d2ee5
docs: 관리자 회비 API 문서와 에러 메시지를 실제 동작에 맞춘다
xeoxxn 3712c94
refactor: 납부 여부 변경 이벤트 기록을 후속 member 작업으로 미룬다
xeoxxn 96d37eb
refactor: 관리자 안내 문구를 반려 사유(rejectReason)로 이름을 바꾼다
xeoxxn 497a897
refactor: 납부 요청 시각을 requested_at 대신 created_at으로 쓴다
xeoxxn 3c2bd38
refactor: 회비 마이그레이션을 최종 스키마 기준 세 개로 합친다
xeoxxn 2eb5ef1
feat: 가입을 마친 회원 ID를 한 번에 조회한다
xeoxxn 6b98eb3
fix: 탈퇴 회원의 요청이 있어도 관리자 납부자 목록이 열리게 한다
xeoxxn abb0122
docs: 지운 FeeAmountCalculator를 가리키던 대여 주석을 고친다
xeoxxn 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
43 changes: 43 additions & 0 deletions
43
...api/src/main/java/kr/ac/kookmin/stream/api/admin/welfare/fee/AdminFeeAccountProvider.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,43 @@ | ||
| package kr.ac.kookmin.stream.api.admin.welfare.fee; | ||
|
|
||
| import java.util.Map; | ||
| import kr.ac.kookmin.stream.internal.domain.config.service.AdminConfigValueService; | ||
| import kr.ac.kookmin.stream.welfare.WelfareConstants; | ||
| import kr.ac.kookmin.stream.welfare.domain.fee.domain.FeeAccount; | ||
| import kr.ac.kookmin.stream.welfare.domain.fee.domain.FeeConfigKeys; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| /** | ||
| * 회비 납부 설정을 읽고 쓴다. welfare 도메인은 internal 모듈에 의존할 수 없어 이 조합을 api에 둔다. | ||
| * <p> | ||
| * 학생 쪽과 달리 계좌가 없어도 예외를 던지지 않는다 — 관리자 화면은 "아직 설정하지 않음"을 보여주고 | ||
| * 그 자리에서 설정하게 해야 하기 때문이다. | ||
| */ | ||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class AdminFeeAccountProvider { | ||
|
|
||
| private final AdminConfigValueService adminConfigValueService; | ||
|
|
||
| public FeeAccount getAccount() { | ||
| return FeeAccount.of( | ||
| adminConfigValueService.getValue(FeeConfigKeys.TRANSFER_BANK).orElse(null), | ||
| adminConfigValueService.getValue(FeeConfigKeys.TRANSFER_ACCOUNT_NO).orElse(null), | ||
| adminConfigValueService.getValue(FeeConfigKeys.TRANSFER_AMOUNT) | ||
| .map(Long::parseLong) | ||
| .orElse(WelfareConstants.DEFAULT_TRANSFER_AMOUNT) | ||
| ); | ||
| } | ||
|
|
||
| // 계좌와 금액은 한 화면에서 같이 저장하므로 세 키를 한 번에 쓴다 | ||
| public FeeAccount save(String bank, String accountNo, long amountPerSemester) { | ||
| FeeAccount account = FeeAccount.create(bank, accountNo, amountPerSemester); | ||
| adminConfigValueService.upsertValues(Map.of( | ||
| FeeConfigKeys.TRANSFER_BANK, account.bank(), | ||
| FeeConfigKeys.TRANSFER_ACCOUNT_NO, account.accountNo(), | ||
| FeeConfigKeys.TRANSFER_AMOUNT, String.valueOf(account.amountPerSemester()) | ||
| )); | ||
| return account; | ||
| } | ||
| } |
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
27 changes: 27 additions & 0 deletions
27
...main/java/kr/ac/kookmin/stream/api/admin/welfare/fee/request/FeeAccountUpdateRequest.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,27 @@ | ||
| package kr.ac.kookmin.stream.api.admin.welfare.fee.request; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Pattern; | ||
| import jakarta.validation.constraints.Positive; | ||
|
|
||
| /** | ||
| * 회비 납부 설정 변경. 계좌와 학기당 회비를 한 화면에서 같이 저장하므로 함께 받는다. | ||
| */ | ||
| public record FeeAccountUpdateRequest( | ||
| @Schema(description = "은행명 (허용 목록 중 하나)", example = "카카오뱅크") | ||
| @NotBlank(message = "은행을 선택해 주세요.") | ||
| String bank, | ||
|
|
||
| @Schema(description = "계좌번호 (하이픈 제외, 10~14자리)", example = "3333011234567") | ||
| @NotBlank(message = "계좌번호를 입력해 주세요.") | ||
| @Pattern(regexp = "^\\d{10,14}$", message = "계좌번호는 하이픈 없이 숫자 10~14자리로 입력해 주세요.") | ||
| String accountNo, | ||
|
|
||
| @Schema(description = "학기당 학생회비", example = "20000") | ||
| @NotNull(message = "학기당 학생회비를 입력해 주세요.") | ||
| @Positive(message = "학기당 학생회비는 1원 이상이어야 합니다.") | ||
| Integer amount | ||
| ) { | ||
| } | ||
12 changes: 0 additions & 12 deletions
12
.../main/java/kr/ac/kookmin/stream/api/admin/welfare/fee/request/FeeAmountUpdateRequest.java
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
...rc/main/java/kr/ac/kookmin/stream/api/admin/welfare/fee/request/FeeLinkUpdateRequest.java
This file was deleted.
Oops, something went wrong.
16 changes: 13 additions & 3 deletions
16
.../main/java/kr/ac/kookmin/stream/api/admin/welfare/fee/request/FeeStatusUpdateRequest.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 |
|---|---|---|
| @@ -1,9 +1,19 @@ | ||
| package kr.ac.kookmin.stream.api.admin.welfare.fee.request; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import kr.ac.kookmin.stream.welfare.domain.fee.domain.TransferStatus; | ||
|
|
||
| /** | ||
| * 납부 상태 변경. 반려 사유는 확인필요(REJECTED)일 때만 필수라, 필수 여부와 길이는 도메인이 검증한다. | ||
| */ | ||
| public record FeeStatusUpdateRequest( | ||
| @NotBlank(message = "처리 상태를 입력해 주세요.") | ||
| String status | ||
| @Schema(description = "변경할 납부 상태", example = "REJECTED") | ||
| @NotNull(message = "변경할 납부 상태를 입력해 주세요.") | ||
| TransferStatus status, | ||
|
|
||
| @Schema(description = "학생에게 보여줄 반려 사유 (최대 255자). 확인필요일 때 필수", | ||
| example = "입금자 정보를 확인하지 못했어요. 문제가 있을 경우 학생회에 문의해 주세요.") | ||
| String rejectReason | ||
| ) { | ||
| } |
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.