Skip to content

Commit

Permalink
ECWID-155668 Add "updateShippingOption" method to ecwid-java-api-clie…
Browse files Browse the repository at this point in the history
…nt - (refactor) fix detekt: get rid of magic numbers
  • Loading branch information
RomanTimchenkoLightspeed committed Jan 22, 2025
1 parent b754075 commit 1109053
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.ecwid.apiclient.v3.dto.profile.enums

private const val MINUTES_IN_DAY = 1_440 // 24 hours * 60 minutes
private const val MINUTES_IN_MONTH = 43_200 // 30 * MINUTES_IN_DAY

@Suppress("unused")
enum class AvailabilityPeriodTimeUnit(val valueInMinutes: Int) {
DAYS(24 * 60),
MONTHS(30 * 24 * 60);
DAYS(MINUTES_IN_DAY),
MONTHS(MINUTES_IN_MONTH)
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package com.ecwid.apiclient.v3.dto.profile.enums

private const val DAYS_IN_WEEK = 7
private const val SINGLE_UNIT = 1
private const val MONTHS_IN_CENTURY = 1200

@Suppress("unused")
enum class AvailabilityPeriodType(val unitCount: Int, val unit: AvailabilityPeriodTimeUnit?) {
SEVEN_DAYS(7, AvailabilityPeriodTimeUnit.DAYS),
ONE_MONTH(1, AvailabilityPeriodTimeUnit.MONTHS),
UNLIMITED(1200, AvailabilityPeriodTimeUnit.MONTHS);
SEVEN_DAYS(DAYS_IN_WEEK, AvailabilityPeriodTimeUnit.DAYS),
ONE_MONTH(SINGLE_UNIT, AvailabilityPeriodTimeUnit.MONTHS),
UNLIMITED(MONTHS_IN_CENTURY, AvailabilityPeriodTimeUnit.MONTHS)
}

0 comments on commit 1109053

Please sign in to comment.