Skip to content

Commit b963275

Browse files
Add skeleton for CIAB eligibility checking
1 parent 3e89351 commit b963275

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.woocommerce.android.ciab
2+
3+
enum class CIABAffectedFeature {
4+
Blaze,
5+
Payments,
6+
WooShippingSplitShipments,
7+
GroupedProducts,
8+
VariableProducts,
9+
GiftCardEditing,
10+
ProductsStockDashboardCard
11+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.woocommerce.android.ciab
2+
3+
import androidx.annotation.VisibleForTesting
4+
import com.woocommerce.android.tools.SelectedSite
5+
import javax.inject.Inject
6+
7+
class CIABSiteGateKeeper @Inject constructor(private val selectedSite: SelectedSite) {
8+
fun isFeatureSupported(
9+
@Suppress("unused")
10+
feature: CIABAffectedFeature
11+
): Boolean {
12+
// For now, all affected features are unsupported in CIAB.
13+
// If there are exceptions in the future, we can handle them here.
14+
return !isCurrentSiteCIAB()
15+
}
16+
17+
fun isFeatureUnsupported(feature: CIABAffectedFeature): Boolean {
18+
return !isFeatureSupported(feature)
19+
}
20+
21+
private fun isCurrentSiteCIAB(): Boolean {
22+
TODO()
23+
}
24+
25+
companion object Companion {
26+
@VisibleForTesting
27+
const val CIAB_GARDEN_NAME = "commerce"
28+
}
29+
}

0 commit comments

Comments
 (0)