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-304] feature: 회원 생존신고 게시글 업로드 여부 / 가족 미션 참여 가능 여부 확인 API 구현 #240

Merged
merged 10 commits into from
Apr 24, 2024

Conversation

Ji-soo708
Copy link
Member

@Ji-soo708 Ji-soo708 commented Apr 24, 2024

❓ 기능 추가 배경


회원 생존신고 게시글 업로드 여부 / 가족 미션 참여 가능 여부 확인 API를 구현했습니다.

➕ 추가/변경된 기능


  • 회원 생존신고 게시글 업로드 여부 API 실제 로직 구현
    • MainViewApi 응답 필드에 맞춰 해당 API도 응답 필드명 변경
  • 가족 미션 참여 가능 여부 확인 API 실제 로직구현
    • MainViewApi 응답 필드에 맞춰 해당 API도 응답 필드명 변경
  • 테스트코드 작성
  • MainViewApi/getDaytimePage에 회원 생존신고 게시글 업로드 여부 / 가족 미션 참여 가능 여부 확인 로직 연결

🥺 리뷰어에게 하고싶은 말


리뷰 잘부탁드립니다~

🔗 참조 or 관련된 이슈


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

🔗 참조 or 관련된 이슈


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

@Ji-soo708 Ji-soo708 self-assigned this Apr 24, 2024
@Ji-soo708 Ji-soo708 requested review from Kwon770 and CChuYong April 24, 2024 08:51
Copy link

github-actions bot commented Apr 24, 2024

Test Results

 40 files   40 suites   10s ⏱️
114 tests 114 ✅ 0 💤 0 ❌
115 runs  115 ✅ 0 💤 0 ❌

Results for commit c24df49.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 24, 2024

Code Coverage

File Coverage [53.04%]
MissionAvailableStatusResponse.java 100% 🍏
SurvivalUploadStatusResponse.java 100% 🍏
PostRepositoryCustomImpl.java 84.57% 🍏
PostController.java 62.44%
PostService.java 61.56%
MainViewController.java 4.75%
Total Project Coverage 47.15% 🍏

Copy link

sonarcloud bot commented Apr 24, 2024

Quality Gate Passed Quality Gate passed

Issues
0 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

Kwon770 commented Apr 24, 2024

@Ji-soo708 혹시 뷰 단에만 missionUnlocked 용어를 쓰고 내부는 isCreatedSurvivalPostByMajority와 같이 작성한 이유가 있을까용?

@Ji-soo708
Copy link
Member Author

Ji-soo708 commented Apr 24, 2024

@Ji-soo708 혹시 뷰 단에만 missionUnlocked 용어를 쓰고 내부는 isCreatedSurvivalPostByMajority와 같이 작성한 이유가 있을까용?

Repository와 Service의 메서드 명을 말하시는 거 맞나요?
일단 Repository에서는 isCreatedSurvivalPostByMajority 용어가 missionUnlocked 용어보다 해당 메서드가 DB에 접근해서 어떤 로직(ex. 가족 구성원 절반 이상이 생존신고 글을 작성하는지 확인)을 수행하는지 명확히 표현한다고 생각해 isCreatedSurvivalPostByMajority를 사용했습니다!
하지만 Service는 비즈니스 로직을 담당하니까 Service의 메서드 명은 isMissionUnlocked로 바꿔도 좋다고 생각합니다!

@Kwon770
Copy link
Collaborator

Kwon770 commented Apr 24, 2024

음 어렵네요.. 원래 쓰던 구조에서는 Service는 비즈니스 코드의 영역으로 생각해서 메소드명 또한 비즈니스 기능의 의미를 나타내는 식으로 명명했는데, 현재 저의 구조에서는 Controller가 Controller Facade역할도 강하다보니 지수님의 말도 맞는거 같아요. 일단 이대로 진행해봅시다! LGTM

@Kwon770 Kwon770 merged commit 7f36605 into dev Apr 24, 2024
4 checks passed
@Kwon770 Kwon770 deleted the feature/OING-304 branch April 24, 2024 14:50
Ji-soo708 added a commit that referenced this pull request May 9, 2024
* 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
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 <[email protected]>

---------

Co-authored-by: 송영민 (YeongMin Song) <[email protected]>
Co-authored-by: sckwon770 <[email protected]>
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.

3 participants