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

Documentation : Banking #2

Closed
this-is-spear opened this issue Feb 13, 2023 · 0 comments · Fixed by #3
Closed

Documentation : Banking #2

this-is-spear opened this issue Feb 13, 2023 · 0 comments · Fixed by #3
Labels
documentation Changes only affect the documentation

Comments

@this-is-spear
Copy link
Owner

this-is-spear commented Feb 13, 2023

Dictionary

영문 한글 설명
User 사용자 서비스를 사용하는 사람.
Account 계좌 계좌를 관리하기 위한 단위.
잔액과 사용 내역 정보 포함.
사용자는 최소 하나 이상의 계좌를 가짐.
AccountBalance 계좌 잔액 계좌 잔액을 의미.
계좌의 Balance.
AccountHistory 계좌 사용 기록 계좌 금액 변동 내역 의미.
기록 타입 정보를 가진다.
HistoryType 기록 타입 기록 타입은 입금(DEPOSIT), 출금(WITHDRAW) 중 하나의 정보를 가진다.
AccountHistoryList 계좌 사용 목록 AccountHistory의 모음.
Money 금액 돈을 관리하는 단위.
0원 이상이어야 한다.

Modeling

AccoutController

  • 사용자의 계좌(AccountNumber)를 입력해 잔액(AccountBalance)과 사용 목록(AccountHistoryList)을 반환한다.(getAccountBalanceAndAccountHistory)
    • 세션(Session)에서 사용자의 정보(User)를 식별해 사용자의 계좌가 맞는지 확인한다.
    • 잔액(Balance)과 사용 목록(AccountHistoryList)을 반환한다.
  • 사용자의 계좌 정보(FromAccountNumber), 상대방의 계좌 정보(ToAccountNumber), 금액(Money)을 입력받아 돈을 이체한다. (transferMoney)
    • 세션(Session)에서 사용자의 정보(User)를 식별해 사용자의 계좌가 맞는지 확인한다.
    • 돈(Money)을 이체한다.
  • 사용자의 정보를 식별해 계좌 이체할 상대방의 리스트를 반환한다.(getTargetsToBeTransfer) - (임시)
    • 이체할 상대방의 리스트(Targets)를 반환한다.

AccoutApplicationService

  • 계좌 번호(AccountNumber)로 잔액(AccountBalance)과 히스토리(AccountHistory)을 반환한다.
    • 사용자 계좌 히스토리(AccountHistory)를 조회한다.
    • 사용자 계좌 잔액(AccountBalance)을 조회한다.
  • 사용자의 계좌(FromAccountNumber)에서 상대방(ToAccountNumber)에게 입력받은 금액을 이체한다.
    • 계좌 이체한다.
    • 계좌 이체가 완료된 이후 사용자에게 이체 완료 알람을 보낸다.
    • 계좌 이체가 완료된 이후 상대방에게 입금 완료 알람을 보낸다.
  • 사용자 리스트를 반환한다. - (임시)
    • 전체 사용자 계좌 번호(AccountNumber) 리스트를 반환한다.

AccountService

  • 계좌를 조회한다.
  • 계좌에 입금하다.
    • 사용자의 계좌 번호(AccountNumber)를 입력해 히스토리(AccountHistory)에 입금 정보를 추가한다.
  • 계좌에 출금하다.
    • 사용자의 계좌 번호(AccountNumber)를 입력해 히스토리(AccountHistory)에 지출 정보를 추가한다.
  • 계좌 이체한다.
    • 계좌 번호(FromAccountNumber, ToAccountNumber)가 존재해야 한다.
    • 같은 계좌에 이체할 수 없다.
    • 사용자의 계좌에서 상대방의 계좌로 금액을 이체한다.
    • 사용자의 계좌 번호(AccountNumber)를 입력해 히스토리(AccountHistory)에 지출 정보를 추가한다.
    • 상대방의 계좌 번호(AccountNumber)를 입력해 히스토리(AccountHistory)에 입금 정보를 추가한다.

ConcurrencyManager

  • 동시성을 제어한다.
    • 다른 사용자의 접근을 제한한다.
    • 사용자의 동작을 진행한다.
    • 다른 사용자의 제한을 해제한다.

LockRepository

  • 다른 사용자의 접근을 제한한다.
  • 다른 사용자의 제한을 해제한다.

UserRepository

  • 사용자 정보를 저장한다.
  • 사용자 정보를 반환한다.
  • 사용자의 전체 리스트를 반환한다.

AccountRepository

  • 계좌를 생성한다.
  • 계좌 정보를 반환한다.

AccountHistory

  • 계좌 사용 기록을 저장한다.
  • 계좌 사용 기록 목록을 반환한다.

AccountNumberGenerator

  • 계좌 번호를 생성한다.

User

  • 상태
    • 사용자 식별자(userId), 아이디(Id), 이름(name), 비밀번호(Password)를 가진다.

Account

  • 상태
    • 계좌 식별자(Id), 계좌 번호(AccountNumber), 사용자 식별자(UserId), 계좌 잔액(Balance) 정보를 가진다.
      • 계좌 번호는 유일하다.
      • 계좌 잔액은 금액(Money)의 정보이다.
  • 행위
    • 금액을 출금한다.
    • 금액을 입금한다.

AccountNumber

  • 상태
    • 계좌 번호는 숫자와 - 의 조합이다.
    • 계좌 번호의 숫자는 총 13 자리이다.
    • 계좌 번호의 포맷은 xxx-xxxx-xxxxxx 이다.

Money

  • 상태
    • 금액을 의미한다.
    • 금액(Money)은 0 원 이상이어야 한다.

AccountHistories

  • 상태
    • 사용자의 계좌 이체 사용 기록(AccountHistory) 목록을 가진다.

AccountHistory

  • 상태
    • 히스토리 식별자(Id), 계좌 번호(FromAccountNumber)와, 상대 계좌 번호(ToAccountNumber) 기록 타입(HistoryType)과 금액(Money), 계좌 잔액(Balance), 기록 날짜(RecordDate)을 포함한다.
    • 기록 타입(HistoryType)은 입금(DEPOSIT), 출금(WITHDRAW) 중 하나의 정보를 포함한다.

참고 사항

  • 도메인 관련 용어는 금융 API를 제공하는 Exness, Toss에서 참고했습니다.
@this-is-spear this-is-spear added the documentation Changes only affect the documentation label Feb 13, 2023
@this-is-spear this-is-spear changed the title Modeling : Banking Documentation : Banking Feb 13, 2023
@this-is-spear this-is-spear linked a pull request Feb 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes only affect the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant