Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ data class RecruitmentDetailsEntity(
val isApplicable: Boolean,
val bookmarked: Boolean,
val winterIntern: Boolean,
val integrationPlan: Boolean,
val integrationPlan: Boolean?,
val hireConvertible: Boolean?,
)

@Immutable
Expand Down Expand Up @@ -73,6 +74,7 @@ internal fun FetchRecruitmentDetailsResponse.toEntity() = RecruitmentDetailsEnti
bookmarked = this.bookmarked,
winterIntern = this.winterIntern,
integrationPlan = this.integrationPlan,
hireConvertible = this.hireConvertible,
)

private fun Areas.toEntity() = AreasEntity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ data class FetchRecruitmentDetailsResponse(
@Json(name = "is_applicable") val isApplicable: Boolean,
@Json(name = "bookmarked") val bookmarked: Boolean,
@Json(name = "winter_intern") val winterIntern: Boolean,
@Json(name = "integration_plan") val integrationPlan: Boolean,
@Json(name = "integration_plan") val integrationPlan: Boolean?,
@Json(name = "hire_convertible") val hireConvertible: Boolean?,
Comment on lines +28 to +29
Copy link
Contributor

Choose a reason for hiding this comment

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

๐Ÿ’ก Codebase verification

API ์‘๋‹ต๊ณผ ์—”ํ‹ฐํ‹ฐ ๊ฐ„์˜ nullable ํƒ€์ž… ๋ถˆ์ผ์น˜ ๋ฐœ๊ฒฌ

RecruitmentDetailsEntity์™€ FetchRecruitmentDetailsResponse ๊ฐ„์˜ ๋งคํ•‘์—์„œ integrationPlan๊ณผ hireConvertible ํ•„๋“œ์˜ nullable ์ฒ˜๋ฆฌ๊ฐ€ ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์—”ํ‹ฐํ‹ฐ ํด๋ž˜์Šค๋„ ์ด์— ๋งž์ถฐ ์—…๋ฐ์ดํŠธ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

  • core/domain/src/main/java/team/retum/usecase/entity/RecruitmentDetailsEntity.kt ํŒŒ์ผ์—์„œ ํ•ด๋‹น ํ•„๋“œ๋“ค์„ nullable๋กœ ์„ ์–ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • toEntity() ๋งคํ•‘ ํ•จ์ˆ˜์— hireConvertible ํ•„๋“œ ๋งคํ•‘์„ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
๐Ÿ”— Analysis chain

nullable ํƒ€์ž… ๋ณ€๊ฒฝ ๋ฐ ์ถ”๊ฐ€์— ๋Œ€ํ•œ ๊ฒ€ํ† 

integrationPlan๊ณผ hireConvertible ํ•„๋“œ๊ฐ€ nullable๋กœ ์„ค์ •๋œ ๊ฒƒ์ด ํ™•์ธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. API ์‘๋‹ต์—์„œ ํ•ด๋‹น ํ•„๋“œ๋“ค์ด ์„ ํƒ์ ์œผ๋กœ ์ œ๊ณต๋  ์ˆ˜ ์žˆ์Œ์„ ๊ณ ๋ คํ•  ๋•Œ ์ ์ ˆํ•œ ๋ณ€๊ฒฝ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ๊ด€๋ จ ์—”ํ‹ฐํ‹ฐ์™€ ๋งคํ•‘ ๋กœ์ง์ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์—…๋ฐ์ดํŠธ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค:


Let me generate another script to check the RecruitmentDetailsEntity and its mapping logic:


Let me check one more thing to verify the mapping between the response and entity:

๐Ÿ Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the corresponding entity class and mapping logic
# Test: Search for RecruitmentDetailsEntity and toEntity function
rg -A 5 "RecruitmentDetailsEntity|toEntity"

Length of output: 42497


Script:

#!/bin/bash
# Search for RecruitmentDetailsEntity definition and its properties
rg -A 15 "data class RecruitmentDetailsEntity"

Length of output: 1842


Script:

#!/bin/bash
# Search for the mapping function between FetchRecruitmentDetailsResponse and RecruitmentDetailsEntity
rg -A 20 "FetchRecruitmentDetailsResponse.*toEntity"

Length of output: 2593

)

@JsonClass(generateAdapter = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ private fun RecruitmentDetailInfo(
title = stringResource(id = R.string.etc),
content = etc,
)
if (winterIntern) {
if (winterIntern && integrationPlan != null) {
Detail(
title = stringResource(id = R.string.integration_plan),
content = "${if (integrationPlan) "์žˆ" else "์—†"}์Œ",
content = "${if (integrationPlan!!) "์žˆ" else "์—†"}์Œ",
)
}
Comment on lines +256 to +261
Copy link
Contributor

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

!! ์—ฐ์‚ฐ์ž ์‚ฌ์šฉ์— ๋Œ€ํ•œ ์•ˆ์ „์„ฑ ๊ฐœ์„  ํ•„์š”

integrationPlan!!์™€ ๊ฐ™์€ ๊ฐ•์ œ unwrap ์—ฐ์‚ฐ์ž ์‚ฌ์šฉ์€ ๋Ÿฐํƒ€์ž„์— NullPointerException์„ ๋ฐœ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. null ์ฒดํฌ๋ฅผ ์ด๋ฏธ ์ˆ˜ํ–‰ํ–ˆ์œผ๋ฏ€๋กœ ์ด๋Š” ๋ถˆํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

            if (winterIntern && integrationPlan != null) {
                Detail(
                    title = stringResource(id = R.string.integration_plan),
-                    content = "${if (integrationPlan!!) "์žˆ" else "์—†"}์Œ",
+                    content = "${if (integrationPlan) "์žˆ" else "์—†"}์Œ",
                )
            }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (winterIntern && integrationPlan != null) {
Detail(
title = stringResource(id = R.string.integration_plan),
content = "${if (integrationPlan) "์žˆ" else "์—†"}์Œ",
content = "${if (integrationPlan!!) "์žˆ" else "์—†"}์Œ",
)
}
if (winterIntern && integrationPlan != null) {
Detail(
title = stringResource(id = R.string.integration_plan),
content = "${if (integrationPlan) "์žˆ" else "์—†"}์Œ",
)
}

if(!winterIntern && hireConvertible != null) {
Detail(
title = stringResource(id = R.string.hireConvertible),
content = "${if (hireConvertible!!) "์žˆ" else "์—†"}์Œ",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

!! ์—ฐ์‚ฐ์ž ์‚ฌ์šฉ์— ๋Œ€ํ•œ ์•ˆ์ „์„ฑ ๊ฐœ์„  ํ•„์š”

hireConvertible!!์—์„œ๋„ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

            if(!winterIntern && hireConvertible != null) {
                Detail(
                    title = stringResource(id = R.string.hireConvertible),
-                    content = "${if (hireConvertible!!) "์žˆ" else "์—†"}์Œ",
+                    content = "${if (hireConvertible) "์žˆ" else "์—†"}์Œ",
                )
            }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(!winterIntern && hireConvertible != null) {
Detail(
title = stringResource(id = R.string.hireConvertible),
content = "${if (hireConvertible!!) "์žˆ" else "์—†"}์Œ",
)
if(!winterIntern && hireConvertible != null) {
Detail(
title = stringResource(id = R.string.hireConvertible),
content = "${if (hireConvertible) "์žˆ" else "์—†"}์Œ",
)

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal data class RecruitmentDetailsState(
bookmarked = false,
winterIntern = false,
integrationPlan = false,
hireConvertible = false,
),
buttonEnabled = false,
)
Expand Down
1 change: 1 addition & 0 deletions feature/recruitment/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<string name="submission_document">์ œ์ถœ ์„œ๋ฅ˜</string>
<string name="etc">๊ธฐํƒ€ ์‚ฌํ•ญ</string>
<string name="integration_plan">ํ˜„์žฅ์‹ค์Šต ์—ฐ๊ณ„ ๊ณ„ํš</string>
<string name="hireConvertible">์ฑ„์šฉ์ „ํ™˜ ๊ฐ€๋Šฅ ์—ฌ๋ถ€</string>
<string name="apply">์ง€์›ํ•˜๊ธฐ</string>
<string name="can_do_not_apply">์ง€์›ํ•  ์ˆ˜ ์—†์–ด์š”</string>
<string name="major_task">์ฃผ์š” ์—…๋ฌด</string>
Expand Down
Loading