Skip to content

Commit 228fd4e

Browse files
📝 Add docstrings to feature/468-면접후기-기능-리팩토링
Docstrings generation was requested by @uson1004. * #473 (comment) The following files were modified: * `app/src/main/java/team/retum/jobisandroidv2/JobisNavigator.kt` * `app/src/main/java/team/retum/jobisandroidv2/navigation/MainNavigation.kt` * `app/src/main/java/team/retum/jobisandroidv2/root/RootNavigation.kt` * `app/src/main/java/team/retum/jobisandroidv2/root/RootScreen.kt` * `core/data/src/main/java/team/retum/data/repository/review/ReviewRepository.kt` * `core/data/src/main/java/team/retum/data/repository/review/ReviewRepositoryImpl.kt` * `core/design-system/src/main/java/team/retum/jobisdesignsystemv2/review/ReviewContent.kt` * `core/domain/src/main/java/team/retum/usecase/entity/FetchReviewDetailEntity.kt` * `core/domain/src/main/java/team/retum/usecase/entity/FetchReviewsEntity.kt` * `core/domain/src/main/java/team/retum/usecase/entity/MyReviews.kt` * `core/domain/src/main/java/team/retum/usecase/entity/PostReviewEntity.kt` * `core/domain/src/main/java/team/retum/usecase/entity/QuestionsEntity.kt` * `core/domain/src/main/java/team/retum/usecase/entity/ReviewsCountEntity.kt` * `core/domain/src/main/java/team/retum/usecase/usecase/review/FetchMyReviewUseCase.kt` * `core/domain/src/main/java/team/retum/usecase/usecase/review/FetchQuestionsUseCase.kt` * `core/domain/src/main/java/team/retum/usecase/usecase/review/FetchReviewsCountUseCase.kt` * `core/domain/src/main/java/team/retum/usecase/usecase/review/FetchReviewsUseCase.kt` * `core/network/src/main/java/team/retum/network/api/ReviewApi.kt` * `core/network/src/main/java/team/retum/network/datasource/review/ReviewDataSource.kt` * `core/network/src/main/java/team/retum/network/datasource/review/ReviewDataSourceImpl.kt` * `feature/bookmark/src/main/java/team/retum/bookmark/ui/BookmarkScreen.kt` * `feature/company/src/main/java/team/retum/company/navigation/CompanyDetailsNavigation.kt` * `feature/company/src/main/java/team/retum/company/ui/CompanyDetailsScreen.kt` * `feature/company/src/main/java/team/retum/company/viewmodel/CompanyDetailsViewModel.kt` * `feature/home/src/main/java/team/retum/home/ui/ApplyCompanyItem.kt` * `feature/home/src/main/java/team/retum/home/ui/HomeScreen.kt` * `feature/mypage/src/main/java/team/retum/jobis/navigation/MyPageNavigation.kt` * `feature/mypage/src/main/java/team/retum/jobis/ui/MyPageScreen.kt` * `feature/post-review/src/main/java/team/retum/post/review/model/PostReviewData.kt` * `feature/post-review/src/main/java/team/retum/post/review/navigation/PostExpectReviewNavigation.kt` * `feature/post-review/src/main/java/team/retum/post/review/navigation/PostNextReviewNavigation.kt` * `feature/post-review/src/main/java/team/retum/post/review/navigation/PostReviewCompleteNavigation.kt` * `feature/post-review/src/main/java/team/retum/post/review/navigation/PostReviewNavigation.kt` * `feature/post-review/src/main/java/team/retum/post/review/ui/PostExpectReviewScreen.kt` * `feature/post-review/src/main/java/team/retum/post/review/ui/PostNextReviewScreen.kt` * `feature/post-review/src/main/java/team/retum/post/review/ui/PostReviewCompleteScreen.kt` * `feature/post-review/src/main/java/team/retum/post/review/ui/PostReviewScreen.kt` * `feature/post-review/src/main/java/team/retum/post/review/viewmodel/PostExpectReviewViewModel.kt` * `feature/post-review/src/main/java/team/retum/post/review/viewmodel/PostNextReviewViewModel.kt` * `feature/post-review/src/main/java/team/retum/post/review/viewmodel/PostReviewViewModel.kt` * `feature/review/src/main/java/team/retum/review/navigation/ReviewDetailsNavigation.kt` * `feature/review/src/main/java/team/retum/review/navigation/ReviewFilterNavigation.kt` * `feature/review/src/main/java/team/retum/review/navigation/ReviewNavigation.kt` * `feature/review/src/main/java/team/retum/review/navigation/SearchReviewsNavigation.kt` * `feature/review/src/main/java/team/retum/review/ui/ReviewDetailsScreen.kt` * `feature/review/src/main/java/team/retum/review/ui/ReviewFilterScreen.kt` * `feature/review/src/main/java/team/retum/review/ui/ReviewScreen.kt` * `feature/review/src/main/java/team/retum/review/ui/SearchReviewScreen.kt` * `feature/review/src/main/java/team/retum/review/ui/component/ReviewItems.kt` * `feature/review/src/main/java/team/retum/review/viewmodel/ReviewDetailsViewModel.kt` * `feature/review/src/main/java/team/retum/review/viewmodel/ReviewFilterViewModel.kt` * `feature/review/src/main/java/team/retum/review/viewmodel/ReviewViewModel.kt` * `feature/review/src/main/java/team/retum/review/viewmodel/SearchReviewsViewModel.kt`
1 parent 6f55f18 commit 228fd4e

File tree

53 files changed

+1283
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1283
-79
lines changed

app/src/main/java/team/retum/jobisandroidv2/JobisNavigator.kt

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,55 @@ internal class JobisNavigator(
130130
navController.navigateToNotices()
131131
}
132132

133+
/**
134+
* Navigates to the landing screen using the provided pop-up route.
135+
*
136+
* @param popUpRoute The navigation route to pop up to when navigating to the landing screen.
137+
*/
133138
fun navigateToLanding(popUpRoute: String) {
134139
navController.navigateToLanding(popUpRoute = popUpRoute)
135140
}
136141

142+
/**
143+
* Navigate to the post-review screen for a specific company.
144+
*
145+
* @param companyName The company's display name to prefill or show on the post-review screen.
146+
* @param companyId The unique identifier of the company to associate the review with.
147+
*/
137148
fun navigateToPostReview(companyName: String, companyId: Long) {
138149
navController.navigateToPostReview(companyName = companyName, companyId = companyId)
139150
}
140151

152+
/**
153+
* Navigates to the post-next-review screen, forwarding the given review data.
154+
*
155+
* @param reviewData The `PostReviewData` to pass to the destination.
156+
*/
141157
fun navigateToPostNextReview(reviewData: PostReviewData) {
142158
navController.navigateToPostNextReview(reviewData = reviewData)
143159
}
144160

161+
/**
162+
* Navigates to the post-review completion screen.
163+
*/
145164
fun navigateToPostReviewComplete() {
146165
navController.navigateToPostReviewComplete()
147166
}
148167

168+
/**
169+
* Navigate to the post-expected-review screen with the provided review data.
170+
*
171+
* @param reviewData Data used to populate the post-expected-review screen.
172+
*/
149173
fun navigateToPostExpectReview(reviewData: PostReviewData) {
150174
navController.navigateToPostExpectReview(reviewData = reviewData)
151175
}
152176

177+
/**
178+
* Navigates to the app's root (landing/home) screen, optionally targeting a specific application.
179+
*
180+
* @param applicationId The application ID to include in the navigation target; pass 0 to navigate to the root without targeting a specific application.
181+
*/
153182
fun navigateToRoot(applicationId: Long = 0) {
154183
navController.navigateToRoot(applicationId = applicationId)
155184
}
@@ -194,29 +223,56 @@ internal class JobisNavigator(
194223
navController.navigateToSearchCompanies()
195224
}
196225

226+
/**
227+
* Navigate to the notice details screen for the specified notice.
228+
*
229+
* @param noticeId The identifier of the notice to display.
230+
*/
197231
fun navigateToNoticeDetails(noticeId: Long) {
198232
navController.navigateToNoticeDetails(noticeId = noticeId)
199233
}
200234

235+
/**
236+
* Navigates to the review details screen for the specified review.
237+
*
238+
* @param reviewId The identifier of the review to display.
239+
*/
201240
fun navigateToReviewDetails(reviewId: Long) {
202241
navController.navigateToReviewDetails(reviewId = reviewId)
203242
}
204243

244+
/**
245+
* Navigates to the review search screen.
246+
*/
205247
fun navigateToSearchReview() {
206248
navController.navigateToSearchReview()
207249
}
208250

251+
/**
252+
* Navigates to the review filter screen.
253+
*/
209254
fun navigateToReviewFilter() {
210255
navController.navigateToReviewFilter()
211256
}
212257

258+
/**
259+
* Navigates to the review screen for the given company.
260+
*
261+
* @param companyId The company's unique identifier.
262+
* @param companyName The company's display name.
263+
*/
213264
fun navigateToReview(
214265
companyId: Long,
215266
companyName: String,
216267
) {
217268
navController.navigateToReview()
218269
}
219270

271+
/**
272+
* Determine whether navigation originated from the notifications screen.
273+
*
274+
* @return `true` if the previous back-stack entry's route equals `NAVIGATION_NOTIFICATIONS`, `false` otherwise.
275+
*/
220276
fun navigatedFromNotifications(): Boolean {
221277
return navController.previousBackStackEntry?.destination?.route == NAVIGATION_NOTIFICATIONS
222278
}
@@ -241,4 +297,4 @@ internal fun rememberJobisNavigator(
241297
navController: NavHostController = rememberNavController(),
242298
): JobisNavigator = remember(navController) {
243299
JobisNavigator(navController)
244-
}
300+
}

app/src/main/java/team/retum/jobisandroidv2/navigation/MainNavigation.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ import team.retum.review.navigation.searchReview
3131

3232
const val NAVIGATION_MAIN = "main"
3333

34+
/**
35+
* Registers the app's main navigation graph and wires each destination's navigation callbacks to the provided navigator.
36+
*
37+
* Creates a navigation graph with route `NAVIGATION_MAIN` and start destination `NAVIGATION_ROOT`, adding all app
38+
* destinations (root, notifications, recruitment, companies, reviews, posts, etc.) and connecting their navigation
39+
* actions to the given `JobisNavigator`.
40+
*/
3441
internal fun NavGraphBuilder.mainNavigation(
3542
navigator: JobisNavigator,
3643
) {
@@ -138,4 +145,4 @@ internal fun NavGraphBuilder.mainNavigation(
138145
onReviewDetailClick = navigator::navigateToReviewDetails,
139146
)
140147
}
141-
}
148+
}

app/src/main/java/team/retum/jobisandroidv2/root/RootNavigation.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ import team.retum.common.model.ApplicationData
1010
const val NAVIGATION_ROOT = "root"
1111
const val APPLICATION_ID = "applicationId"
1212

13+
/**
14+
* Adds the root navigation destination and wires UI callbacks into the Root composable.
15+
*
16+
* This defines the route "$NAVIGATION_ROOT{$APPLICATION_ID}" with a String `APPLICATION_ID` argument,
17+
* parses that argument to a Long and forwards it as `applicationId` to Root along with all provided callbacks.
18+
*
19+
* @param navigatedFromNotifications True when navigation originated from a notification; forwarded to Root.
20+
*/
1321
fun NavGraphBuilder.root(
1422
onAlarmClick: () -> Unit,
1523
onEmploymentClick: () -> Unit,
@@ -66,4 +74,4 @@ fun NavController.navigateToRoot(applicationId: Long = 0) {
6674
navigate(NAVIGATION_ROOT + applicationId) {
6775
popUpTo(0)
6876
}
69-
}
77+
}

app/src/main/java/team/retum/jobisandroidv2/root/RootScreen.kt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ import team.retum.jobisdesignsystemv2.foundation.JobisTypography
4141
import team.retum.jobisdesignsystemv2.text.JobisText
4242
import team.retum.review.navigation.review
4343

44+
/**
45+
* Hosts the app's root UI, wires navigation and action callbacks, and controls the rejection modal state
46+
* forwarded to RootScreen.
47+
*
48+
* @param applicationId Optional application ID to preselect when entering the app.
49+
* @param navigateToLanding Navigates to the landing (auth/entry) screen.
50+
* @param navigateToApplication Navigates to the application flow with the provided ApplicationData.
51+
* @param navigateToRecruitmentDetails Navigates to the recruitment details screen for the given recruitment ID.
52+
* @param navigatedFromNotifications `true` when the current navigation was initiated from a notification; forwarded to Home.
53+
*/
4454
@Composable
4555
internal fun Root(
4656
applicationId: Long?,
@@ -111,6 +121,21 @@ internal fun Root(
111121
)
112122
}
113123

124+
/**
125+
* Composes the app's main navigation scaffold with a bottom navigation bar and a modal rejection bottom sheet.
126+
*
127+
* Hosts the navigation graph (Home, Recruitments, Bookmarks, Review, MyPage), wires screen-level callbacks into each destination,
128+
* and displays a RejectionBottomSheet using the provided sheet state and rejection reason.
129+
*
130+
* @param sheetState Controls visibility and state of the modal bottom sheet shown for rejection details.
131+
* @param applicationId If non-null, the Home destination will receive this application id to display related content.
132+
* @param showRejectionModal Callback invoked with ApplicationData to open the rejection bottom sheet populated for that application.
133+
* @param rejectionReason Text shown inside the rejection bottom sheet.
134+
* @param navigateToApplicationByRejectionBottomSheet Callback invoked when the user chooses to re-apply from the rejection bottom sheet.
135+
* @param navigateToApplication Callback used to navigate to an application detail screen with the provided ApplicationData.
136+
* @param navigateToRecruitmentDetails Callback used to navigate to a recruitment details screen with the provided recruitment id.
137+
* @param navigatedFromNotifications Indicates whether navigation to Home originated from a notifications entry point (affects Home destination behavior).
138+
*/
114139
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
115140
@Composable
116141
private fun RootScreen(
@@ -234,4 +259,4 @@ private fun RejectionBottomSheet(
234259
onClick = onReApplyClick,
235260
color = ButtonColor.Primary,
236261
)
237-
}
262+
}

core/data/src/main/java/team/retum/data/repository/review/ReviewRepository.kt

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,25 @@ import team.retum.network.model.response.FetchReviewsCountResponse
1010
import team.retum.network.model.response.FetchReviewsResponse
1111

1212
interface ReviewRepository {
13-
suspend fun postReview(reviewRequest: PostReviewRequest)
13+
/**
14+
* Persists a new review using the provided review request data.
15+
*
16+
* @param reviewRequest The request payload containing the review details to save.
17+
*/
18+
suspend fun postReview(reviewRequest: PostReviewRequest)
1419

20+
/**
21+
* Retrieves a page of reviews applying optional filters.
22+
*
23+
* @param page The page number to retrieve; null to use default paging.
24+
* @param location Filter by interview location; null to include all locations.
25+
* @param interviewType Filter by interview type; null to include all types.
26+
* @param keyword Full- or partial-text search term; null to disable keyword filtering.
27+
* @param year Filter reviews by year; null to include all years.
28+
* @param companyId Filter reviews for a specific company id; null to include all companies.
29+
* @param code Additional numeric filter for review classification; null to ignore.
30+
* @return A FetchReviewsResponse containing the matching reviews and related pagination metadata.
31+
*/
1532
suspend fun fetchReviews(
1633
page: Int?,
1734
location: InterviewLocation?,
@@ -22,11 +39,32 @@ interface ReviewRepository {
2239
code: Long?,
2340
): FetchReviewsResponse
2441

25-
suspend fun fetchReviewDetail(reviewId: String): FetchReviewDetailResponse
42+
/**
43+
* Retrieves detailed information for a specific review.
44+
*
45+
* @param reviewId The unique identifier of the review to retrieve.
46+
* @return A FetchReviewDetailResponse containing the review's full details.
47+
*/
48+
suspend fun fetchReviewDetail(reviewId: String): FetchReviewDetailResponse
2649

27-
suspend fun fetchQuestions(): FetchQuestionsResponse
50+
/**
51+
* Retrieves the list of interview questions associated with reviews.
52+
*
53+
* @return A FetchQuestionsResponse containing the available questions and related metadata.
54+
*/
55+
suspend fun fetchQuestions(): FetchQuestionsResponse
2856

29-
suspend fun fetchReviewsCount(): FetchReviewsCountResponse
57+
/**
58+
* Retrieves aggregate counts for reviews.
59+
*
60+
* @return FetchReviewsCountResponse containing the total number of reviews and any available breakdowns by criteria.
61+
*/
62+
suspend fun fetchReviewsCount(): FetchReviewsCountResponse
3063

31-
suspend fun fetchMyReviews(): FetchMyReviewResponse
32-
}
64+
/**
65+
* Retrieves reviews authored by the current authenticated user.
66+
*
67+
* @return `FetchMyReviewResponse` containing the current user's reviews and associated response metadata.
68+
*/
69+
suspend fun fetchMyReviews(): FetchMyReviewResponse
70+
}

core/data/src/main/java/team/retum/data/repository/review/ReviewRepositoryImpl.kt

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,28 @@ import javax.inject.Inject
1414
class ReviewRepositoryImpl @Inject constructor(
1515
private val reviewDataSource: ReviewDataSource,
1616
) : ReviewRepository {
17-
override suspend fun postReview(reviewRequest: PostReviewRequest) =
17+
/**
18+
* Submits a review to the data source.
19+
*
20+
* @param reviewRequest The review payload to submit.
21+
* @return The response returned by the data source after posting the review.
22+
*/
23+
override suspend fun postReview(reviewRequest: PostReviewRequest) =
1824
reviewDataSource.postReview(reviewRequest)
1925

20-
override suspend fun fetchReviews(
26+
/**
27+
* Fetches a paginated list of reviews matching the provided filters.
28+
*
29+
* @param page The page number to retrieve, or `null` to use the default first page.
30+
* @param location Filter by interview location, or `null` to include all locations.
31+
* @param interviewType Filter by interview type, or `null` to include all types.
32+
* @param keyword Filter reviews by keyword contained in their content, or `null` for no keyword filtering.
33+
* @param year Filter reviews by the interview year, or `null` to include all years.
34+
* @param companyId Filter reviews for a specific company ID, or `null` to include all companies.
35+
* @param code Filter reviews by a specific code, or `null` to include all codes.
36+
* @return A FetchReviewsResponse containing the matching reviews and pagination metadata.
37+
*/
38+
override suspend fun fetchReviews(
2139
page: Int?,
2240
location: InterviewLocation?,
2341
interviewType: InterviewType?,
@@ -36,15 +54,36 @@ class ReviewRepositoryImpl @Inject constructor(
3654
code = code,
3755
)
3856

39-
override suspend fun fetchReviewDetail(reviewId: String): FetchReviewDetailResponse =
57+
/**
58+
* Retrieves detailed information for a specific review.
59+
*
60+
* @param reviewId The identifier of the review to retrieve.
61+
* @return A FetchReviewDetailResponse containing the review's detailed data.
62+
*/
63+
override suspend fun fetchReviewDetail(reviewId: String): FetchReviewDetailResponse =
4064
reviewDataSource.fetchReviewDetail(reviewId)
4165

42-
override suspend fun fetchQuestions(): FetchQuestionsResponse =
66+
/**
67+
* Retrieves the predefined review questions used for submitting or displaying reviews.
68+
*
69+
* @return A [FetchQuestionsResponse] containing the list of questions and any related metadata.
70+
*/
71+
override suspend fun fetchQuestions(): FetchQuestionsResponse =
4372
reviewDataSource.fetchQuestions()
4473

45-
override suspend fun fetchReviewsCount(): FetchReviewsCountResponse =
74+
/**
75+
* Retrieves a summary of review counts.
76+
*
77+
* @return A FetchReviewsCountResponse containing the total number of reviews and any related count breakdowns.
78+
*/
79+
override suspend fun fetchReviewsCount(): FetchReviewsCountResponse =
4680
reviewDataSource.fetchReviewsCount()
4781

48-
override suspend fun fetchMyReviews(): FetchMyReviewResponse =
82+
/**
83+
* Retrieves the authenticated user's submitted reviews.
84+
*
85+
* @return A [FetchMyReviewResponse] containing the user's reviews and any associated metadata.
86+
*/
87+
override suspend fun fetchMyReviews(): FetchMyReviewResponse =
4988
reviewDataSource.fetchMyReviews()
50-
}
89+
}

core/design-system/src/main/java/team/retum/jobisdesignsystemv2/review/ReviewContent.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ import team.retum.jobisdesignsystemv2.foundation.JobisTheme
1717
import team.retum.jobisdesignsystemv2.foundation.JobisTypography
1818
import team.retum.jobisdesignsystemv2.text.JobisText
1919

20+
/**
21+
* Displays a tappable card showing a review's author and year.
22+
*
23+
* @param onClick Callback invoked with [reviewId] when the card is clicked.
24+
* @param reviewId Identifier for the review that will be passed to [onClick].
25+
* @param writer Text displayed as the review's author.
26+
* @param year Text displayed as the review's year.
27+
*/
2028
@Composable
2129
fun ReviewContent(
2230
onClick: (Long) -> Unit,
@@ -51,4 +59,4 @@ fun ReviewContent(
5159
)
5260
}
5361
}
54-
}
62+
}

core/domain/src/main/java/team/retum/usecase/entity/FetchReviewDetailEntity.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ data class FetchReviewDetailEntity(
2424
)
2525
}
2626

27+
/**
28+
* Converts a FetchReviewDetailResponse into a FetchReviewDetailEntity.
29+
*
30+
* @return A FetchReviewDetailEntity with metadata fields copied from the response and `qnaResponse` transformed into a list of entity `QnAs`.
31+
*/
2732
internal fun FetchReviewDetailResponse.toEntity() = FetchReviewDetailEntity(
2833
reviewId = this.reviewId,
2934
companyName = this.companyName,
@@ -38,8 +43,13 @@ internal fun FetchReviewDetailResponse.toEntity() = FetchReviewDetailEntity(
3843
answer = this.answer,
3944
)
4045

46+
/**
47+
* Convert a response QnA model into its entity representation.
48+
*
49+
* @return A FetchReviewDetailEntity.QnAs containing the same `id`, `question`, and `answer` as the receiver.
50+
*/
4151
private fun FetchReviewDetailResponse.QnAs.toEntity() = FetchReviewDetailEntity.QnAs(
4252
id = this.id,
4353
question = this.question,
4454
answer = this.answer,
45-
)
55+
)

0 commit comments

Comments
 (0)