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

refactor: 발급 티켓 관련 DDD 적용 리팩토링 및 관리자 티켓 취소 API 작성 #247

Merged
merged 14 commits into from
Feb 1, 2023

Conversation

sanbonai06
Copy link
Member

개요

작업사항

  • 찬진님 작업을 보고 발급 티켓 DDD를 적용해봤습니다.
  • issuedTicket Entity에서 연관관계 매핑 되어있던 이벤트, 티켓 아이템, 유저 Entity 객체를 vo와 id로 변경했습니다.
  • 또, 관리자 권한으로 티켓 취소하는 API를 작성했습니다.
  • 취소 관련 정보들을 저장하는 IssuedTicketCancelInfoVo를 작성했습니다.
  • 또, 유저에 의한 환불과 관리자에 의한 취소를 나타내는 Enum을 추가했습니다.
  • 관리자 권한 티켓 취소도 마찬가지로 itemId로 레디스 락을 걸고 진행합니다.
@RedissonLock(LockName = "티켓관리", identifier = "itemId")
    public void adminCancelIssuedTicket(IssuedTicket issuedTicket, Long itemId) {
        TicketItem ticketItem = ticketItemAdaptor.queryTicketItem(itemId);
        ticketItem.increaseQuantity(1L);
        issuedTicket.adminCancel();
    }
  • 레디스 락이름을 티켓관리로 변경했습니다.

변경로직

  • 내용을 적어주세요.

@sanbonai06 sanbonai06 added For: API [이슈 대상] 외부 API Type: Feature [이슈 목적] 새로운 기능 추가 Type: Refactor [이슈 목적] 프로덕션 코드 리팩토링 labels Jan 31, 2023
@sanbonai06 sanbonai06 self-assigned this Jan 31, 2023
private Event event;
private Long eventId;

@Embedded private IssuedTicketUserInfoVo userInfo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

유저정보는 유저아이디 정보만 저장하면 좋을것 같긴해요...!
IssuedTicketItemInfoVo 정도는 복사저장해도 괜찮을것같은데

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

발급 티켓 리스트를 내려주는 경우에 유저 정보까지 같이 딸려가야해서 이렇게 작성했습니다!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 267 Code Smells

16.5% 16.5% Coverage
0.0% 0.0% Duplication

Copy link
Member

@gengminy gengminy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DDD 적용 확인입니다👍

Copy link
Member

@kim-wonjin kim-wonjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

구조 리펙토링 하시느라 수고하셨습니다 LGTM🌱

@RedissonLock(LockName = "티켓재고관리", identifier = "ticketItemId")
@RedissonLock(LockName = "티켓관리", identifier = "ticketItemId")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

락네임 변경 확인이요!

@sanbonai06 sanbonai06 merged commit 92dfad8 into dev Feb 1, 2023
@sanbonai06 sanbonai06 deleted the refactor/230-issued-ticket-refactoring branch February 1, 2023 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For: API [이슈 대상] 외부 API Type: Feature [이슈 목적] 새로운 기능 추가 Type: Refactor [이슈 목적] 프로덕션 코드 리팩토링
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🚀 [feature] 발급 티켓 도메인에서 타 도메인 의존관계 제거
4 participants