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

[OING-309] feat: Mission, DailyMissionHistory의 API Mocking과 Service feature Mocking #232

Merged
merged 7 commits into from
Apr 16, 2024

Conversation

Kwon770
Copy link
Collaborator

@Kwon770 Kwon770 commented Apr 16, 2024

❓ 기능 추가 배경


프론트와 백엔드 모두에서 기능 개발을 위해 미션 모듈이 필요하기 때문에 API 모킹과 Service 기능 모킹을 진행하였습니다.

➕ 추가/변경된 기능


  • MissionService와 DailyMissionHistoryService를 통해 Service feature mocking
  • DailyMissionHistoryAPI와 DailyMissionHistoryController를 통해 getTodayMission API mocking
  • 포스트를 포함한 타 모듈을 위한 MissionBridge
  • DailyMissionHistory의 Mission 엔티티에 대한 EAGER 로딩 적용

🥺 리뷰어에게 하고싶은 말


@Ji-soo708 요청하신 서비스 기능 모킹이 포함되어있습니다. 코드를 확인하면 활용법을 쉽게 알 수 있을 것입니다.

🔗 참조 or 관련된 이슈


https://no5ing.atlassian.net/browse/OING-309

@Kwon770 Kwon770 requested a review from Ji-soo708 April 16, 2024 13:59
@Kwon770 Kwon770 self-assigned this Apr 16, 2024
@github-actions github-actions bot changed the title feat: Mission, DailyMissionHistory의 API Mocking과 Service feature Mocking [OING-309] feat: Mission, DailyMissionHistory의 API Mocking과 Service feature Mocking Apr 16, 2024
Copy link

github-actions bot commented Apr 16, 2024

Test Results

 40 files   40 suites   10s ⏱️
107 tests 107 ✅ 0 💤 0 ❌
108 runs  108 ✅ 0 💤 0 ❌

Results for commit 67fbc9f.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 16, 2024

Code Coverage

File Coverage [12.02%]
MissionBridgeImpl.java 33.33%
MissionController.java 24.32%
DailyMissionHistoryService.java 21.74%
MissionService.java 18.84%
DailyMissionResponse.java 0%
DailyMissionHistory.java 0%
Total Project Coverage 48.19% 🍏

Copy link
Member

@Ji-soo708 Ji-soo708 left a comment

Choose a reason for hiding this comment

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

모킹 확인했고 이대로 진행해도 좋을 거 같습니다. 코멘트 한 번 확인해주시고 다시 리뷰요청 날려주세요!

Copy link

Quality Gate Passed Quality Gate passed

Issues
8 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Kwon770
Copy link
Collaborator Author

Kwon770 commented Apr 16, 2024

@Ji-soo708 남겨주신 코드리뷰에 해당하는 메소드와 전체 회의에서 언급된 id를 통한 미션 조회 기능이 필요하다 생각되어 API로 추가하여 재리뷰 요청 드립니다!

@Kwon770 Kwon770 requested a review from Ji-soo708 April 16, 2024 15:16
Copy link
Member

@Ji-soo708 Ji-soo708 left a comment

Choose a reason for hiding this comment

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

LGTM 수고하셨습니다~

@Kwon770 Kwon770 merged commit aaf9437 into dev Apr 16, 2024
4 checks passed
@Kwon770 Kwon770 deleted the feature/OING-309 branch April 16, 2024 23:18
Ji-soo708 pushed a commit that referenced this pull request May 9, 2024
Kwon770 added a commit that referenced this pull request May 9, 2024
* chore: update ECS Service name

* chore: update production ecs

* refactor: Translate english error message to Korean (#224)

* [OING-300] feat: 콕 찌르기 API 구현 (#222)

* feat: implementing pick..

* feat: implement pick feature

* feat: add picked members api

* feat: implement picked api

* feat: implement GET api

* feat: check member exists

* feat: update api specs

* feat: concat sql queries

* feat: seperate notification

* [OING-289] refactor: Member 모듈의 안티패턴과 짜잘한 부분 리팩토링 (#223)

* refactor: Remove unused api parameter got by parsing token and reformat parameter sequence from MemberController. MemberApi

* refactor: Rename and reformat the methods in MemberController

* refactor: Rename and reformat the methods in MemberSerivce

* refactor: Fix the anti-pattern of MemberController by moving transactional code to MemberService

* refactor: Refactor minor code dirty

* refactor: Refactor legacy MemberControllerTest by removing unnessary tests and spliting to MemberServiceTest due to anti-pattern refactoring

* refactor: Resolve code smell issue, distinguishing AuthenticationFailedException by ErrorCode

* feat: Add MemberServiceTests for projections methods

* [OING-305] feature: Mission 도입에 맞춰 Post 테이블 변경 (#225)

* feature: add type and mission_id column sql

* feature: add type and mission_id column to Post Entity

* test: fix test due to added column

* feat: change type field's type in Post

* hotfix: add Enumerated annotation (#226)

* hotfix: Type 필드 추가하면서 발생하는 에러 해결 (#227)

* hotfix: add Enumerated annotation

* hotfix: change char to varchar

* [OING-302] feature: 미션 포스트 작성/조회 모킹 API 추가 (#228)

* feat: add type field in constructor

* feat: add mission post create/read mocking api

* test: fix failed test due to added type field

* style: add comment

* refactor: change type's validate logic in create post

* refactor: change type enum value

* refactor: rename Enum Type

* refactor: change if to swith

* feature: change validateUploadTime's bound (#229)

* [OING-307] feat: Mission 모듈 추가 (#230)

* fix: Fix broken flyway db.migration V202404152221__create_Mission_modules_tables.sql (#233)

* [OING-309] feat: Mission, DailyMissionHistory의 API Mocking과 Service feature Mocking (#232)

* [OING-308] feat: 가족구성원 랭킹 API 모킹 (#231)

* feat: Add HomeApi and getFamilyMemberMonthlyRanking spec

* feat: Add getFamilyMemberMonthlyRanking api response mocking at HomeController

* feature: add set type column value sql (#234)

* [OING-314] feature: 회원 생존신고 게시글 업로드 여부 / 회원 미션 참여 가능 여부 확인 mock API 추가 (#235)

* feature: add getMissionEligibleStatus and getSurvivalUploadStatus mock api

* refactor: rename api name and dto field

* [OING-311] feat: 뷰 기반 API 중 메인 페이지 API 구현 (#237)

* feat: add view based api

* docs: update view based api docs

* feat: add isMeUploaded

* fix: update birthday evaluate logics

* [OING-315] feature: 미션 게시글 업로드/조회 API 구현 (검증 로직 제외) (#236)

* refactor: change exception name

* feature: add createMissionPost logic

* feature: add searchMissionPost

* refactor: add available parameter in createPost and fetchDailyFeeds

* refactor: seperate validate logic in mission post

* [OING-317] refactor: 뷰 기반 API를 둘러싼 교통정리 1 (#238)

* feat: Add leftUploadCountUntilMissionUnlock, dailyMissionConten and Add debug parameter to control boolean flag

* refactor: Integrate HomeAPI to MainViewController and Add getNighttimePage API

* fix: Fix wrongly written get mapping url of getNighttimePage

* fix: Add the missing GetMapping annotation and fix wrongly written swagger summary

* [OING-316] feature: 가족 중 몇명이 더 올리면 미션 참여 가능한지 반환하는 API 구현 (#239)

* feature: add getRemainingSurvivalPostCount Api

* feature: add getRemainingSurvivalPostCount logic to getDaytimePage Api

* test: add getRemainingSurvivalPostCount Repository test

* test: add getRemainingSurvivalPostCount Api test

* [OING-304] feature: 회원 생존신고 게시글 업로드 여부 / 가족 미션 참여 가능 여부 확인 API 구현 (#240)

* feature: add getSurvivalUploadStatus API logic

* feature: add getMissionAvailableStatus API

* test: add getMissionAvailable Repository Test

* test: add getMissionAvailable and getSurvivalUploadStatus Api Test

* style: change response dto field name

* feature: add getMissionAvailableStatus and getSurvivalUploadStatus logic to getDaytimePage

* refactor: correct anti code

* refactor: add member.deletedAt.isNull condition to isCreatedSurvivalPostByMajority

* [OING-320] refactor: 가족 중 몇명이 더 올리면 미션 참여 가능한지 반환하는 API 로직 리팩터링 (#242)

* refactor: refact calculateRemainingSurvivalPostCountUntilMissuonUnlocked logic

* feature: add isActiveMember method and refact code

* test: refact test code due to seperated logic

* test: add calculateRemainingSurvivalPostCountUntilMissionUnlocked test code

* [OING-319] feat: 메인 페이지에서 필요한 추가 요청받은 API 구현/모킹 (#241)

* feat: Add mostRecentSurvivalPostDate in FamilyMemberMonthlyRankingResponse according to requirement

* feat: Add isMeMissionUploadedToday field And Rename IsMeUploadedToday as isMeSurvivalUploadedToday from DaytimePageResponse

* fix: Fix broken PostApiTest and Add new test for added api

* refactor: add today date log to validateUserHasNotCreatedPost logic (#243)

* [OING-324] refactor: NighttimeMainPage의 displayRank 필드는 늘 NULL이 되도록 수정 (#245)

* [OING-323] feat: 일간 캘린더 API 추가 (#244)

* feat: Divide getCalendar API to getMonthlyCalendar and getDailyCalendar And Impl getDailyCalendar

* fix: Add CalendarAPI test code for getDailyCalendar and fix the bug found by test code

* refactor: Remove debug system print code

* refactor: Extract the code to map post to calendar response as the method

* refactor: Extract the code to calculate allFamilyMembersUploaded as the method

* fix: Fix the runtime exception during PostType enum mapping

* refactor: Refactoring getXXXCalendar mapping stragey from params to url parameter

* hotfix: Restore getMonthlyCalendar API as deprecated lagacy for compatibilityu

* [OING-328] feat: DailyCalendarResponse에 PostResponse 필드 추가 (프론트 요청) (#247)

* fix: Add the fields of PostResponse in DailyCalendarResponse

* fix: Fix broken CalendarApiTest

* fix: Fix broken CalendarApiTest2

* [OING-325] feat: 가족구성원 랭킹 API 기능 구현 (#246)

* feat: Add getFamilyMembersMonthlySurvivalRanking API in PostController

* feat: Add mvc test code for new API(getFamilyMembersMonthlySurvivalRanking) with nested test class

* feat: Impl getFamilyMemberMonthlyRanking API at MainViewController

* feat: Add mvc test code for new API(getFamilyMemberMonthlyRanking) at MainViewApiTest

* fix: Add stream filter to exclude familyMember who didnt upload post at that month from getFamilyMembersMonthlySurvivalRanking API of PostController and Add test code to validate it from PostApiTest and MainViewApiTest

* fix: Fix failed broken test code

* fix: Fix failed broken test code2

* refactor: Refactor compareTo method of PostRankerDTO for better readability

* refactor: Add blank line at that last of MainViewApiTest

* refactor: Extract duplicated mapping code from getFamilyMemberMonrhlyRanking method of MainViewController

* fix: Fix IndexOutOfBoundsException from getFamilyMemberMonthlyRanking API

* [OING-329] refactor: 미션 검증 로직 중에서 가족 구성원 수 계산할 때, 어제 날짜 기준으로 세도록 수정 (#248)

* refactor: count family members by family ID logic to count based on yesterday's date

* test: fix broken test due to changed logic

* style: change api summary

* refactor: delete unused method

* refactor: refactor isCreatedSurvivalPostByMajority code

* test: delete unused test

* [OING-326] feat: 일일 미션 배치 구현 및 테스트코드 추가 (#249)

* chore: Add mission module path in the targets of cicd modification checking

* feat: Add DailyMissionRegistrationJob in DailyMissionJob with Spring scheduler and table lock

* feat: Impl the methods of MissionService and DailyMissionHistyoryService those api responses was mocked

* feat: Add exceptions handling at DailyMissionRegistrationJob

* feat: Add DailyMissionHistoryRepositoryTest

* feat: Add MissionRepositoryTest for getRandomMissionExcludingIds

* feat: Add DailyMissionJobTest for registerDailyMission

* feat: Add error handling code for duplicated attempting to create daily mission history and catch exception code

* feat: Add tests for newly added error handling and exception catching code

* refactor: Refactor method and parameter name according to naming convention

* refactor: Delete unnecessary Repository annocation from DailyMissionHistoryRepositoryCustomImpl

* fix: Make Nested test class lower case

* fix: Add missing PathVariable at input paramter of getMissionByMissionId (#252)

* [OING-330] feat: 가족 구성원 랭킹에서 '지난 날 생존신고 보기'에 대한 보충 정책 반영 (#250)

* feat: Add getLatestPost API to implement new policy of family member ranking

* fix: Add null handling in getLatestPostAPI

* feat: Make mostRecentSurvivalPostDate return most recent surcicial post date in this month else then return null

* refactor: Refactor nested test class in MianviewApiTest to follow naming convention

* feat: Add test code for findLatestPost in PostRepositoryCustomImpl

* refactor: Add PostType paramter at getRecentPost API

* feat: Add createdAt index at post table

* [OING-318] feature: 미션 게시글 등록 기능에 미션 등록 권한 검증 로직 추가 (#251)

* feature: add validateMissionPostCreateAccessMember logic

* feature: handle Mission Post Access Denied Exceptions

* test: add createMissionPost test

* style: change leftUploadCountUntilMissionUnlock field description

* test: change parameter value in createPost Api test

* test: delete createMissionPost test for normal case

* feature: change exception code

* feat: Restore mistakenly deleted method

* feat: Enable validation code for duplicated family disabled due to iOS buf from on-boarding

---------

Co-authored-by: Kwon770 <sckwon770@gmail.com>

---------

Co-authored-by: 송영민 (YeongMin Song) <jakgon@naver.com>
Co-authored-by: sckwon770 <sckwon770@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants