Coverage Summary for Class: ShowBudgetOwner (cloud.mindbox.mobile_sdk.inapp.domain.interfaces.managers)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| ShowBudgetOwner$Overlay |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(7/7)
|
| ShowBudgetOwner$Place |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(7/7)
|
| Total |
100%
(2/2)
|
|
100%
(2/2)
|
100%
(14/14)
|
package cloud.mindbox.mobile_sdk.inapp.domain.interfaces.managers
import cloud.mindbox.mobile_sdk.inapp.domain.models.Frequency
import cloud.mindbox.mobile_sdk.models.PlaceKey
import cloud.mindbox.mobile_sdk.models.Timestamp
internal interface ShowBudgetManager {
fun holds(owner: ShowBudgetOwner, inAppId: String): Boolean
fun reserve(
owner: ShowBudgetOwner,
inAppId: String,
frequency: Frequency,
isPriority: Boolean
): ShowReservationOutcome
fun commit(
owner: ShowBudgetOwner,
inAppId: String,
frequency: Frequency,
shownAt: Timestamp
)
fun release(owner: ShowBudgetOwner)
fun recordCooldown(frequency: Frequency, at: Timestamp)
}
internal enum class ShowReservationOutcome {
GRANTED,
ALREADY_HELD,
NOT_NEEDED,
REFUSED,
}
internal sealed interface ShowBudgetOwner {
data class Place(val placeSystemName: PlaceKey) : ShowBudgetOwner
data class Overlay(val inAppId: String) : ShowBudgetOwner
}