diff --git a/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt b/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt index 3936a537f..4f018f1ab 100644 --- a/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt +++ b/batch/src/main/kotlin/com/few/batch/service/article/reader/WorkBookSubscriberReader.kt @@ -45,10 +45,19 @@ class WorkBookSubscriberReader( } private fun sendDayCondition(sendDayField: TableField, sendDayCode: BatchDayCode): Condition { - return if (sendDayCode == BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN) { - sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI.code).or(sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN.code)) - } else { - sendDayField.eq(sendDayCode.code) + return when (sendDayCode) { + /** 평일인 경우 매일을 포함하여 전송한다 */ + BatchDayCode.MON_TUE_WED_THU_FRI -> { + sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI.code) + .or(sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN.code)) + } + /** 매일의 경우 매일만 전송한다 */ + BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN -> { + sendDayField.eq(BatchDayCode.MON_TUE_WED_THU_FRI_SAT_SUN.code) + } + else -> { + throw IllegalArgumentException("Invalid sendDayCode: $sendDayCode") + } } } } \ No newline at end of file