Skip to content

Commit a0c7550

Browse files
committed
feat: fixed test, added docs
1 parent 4832d07 commit a0c7550

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

docs/resources/project_settings.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ resource "commercetools_project_settings" "my-project" {
5353
- `carts` (Block List) [Carts Configuration](https://docs.commercetools.com/api/projects/project#carts-configuration) (see [below for nested schema](#nestedblock--carts))
5454
- `countries` (List of String) A two-digit country code as per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
5555
- `currencies` (List of String) A three-digit currency code as per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
56+
- `enable_search_index_customers` (Boolean) Enable the Search Indexing of customers
5657
- `enable_search_index_orders` (Boolean) Enable the Search Indexing of orders
57-
- `enable_search_index_products` (Boolean) Enable the Search Indexing of products
58+
- `enable_search_index_product_search` (Boolean) Enable the Search Indexing of products
59+
- `enable_search_index_products` (Boolean) Enable the Search Indexing of product projections
5860
- `external_oauth` (Block List) [External OAUTH](https://docs.commercetools.com/api/projects/project#externaloauth) (see [below for nested schema](#nestedblock--external_oauth))
5961
- `languages` (List of String) [IETF Language Tag](https://en.wikipedia.org/wiki/IETF_language_tag)
6062
- `messages` (Block List) The change notifications subscribed to (see [below for nested schema](#nestedblock--messages))

internal/resources/project/upgrade_v1.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ var ProjectResourceDataV1 = tftypes.Object{
6363
"countries": tftypes.List{ElementType: tftypes.String},
6464
"languages": tftypes.List{ElementType: tftypes.String},
6565

66-
"enable_search_index_products": tftypes.Bool,
67-
"enable_search_index_orders": tftypes.Bool,
66+
"enable_search_index_products": tftypes.Bool,
67+
"enable_search_index_product_search": tftypes.Bool,
68+
"enable_search_index_orders": tftypes.Bool,
69+
"enable_search_index_customers": tftypes.Bool,
6870

6971
"carts": tftypes.List{
7072
ElementType: tftypes.Object{
@@ -154,9 +156,11 @@ func upgradeStateV0(ctx context.Context, req resource.UpgradeStateRequest, resp
154156
"shipping_rate_cart_classification_value": rawState["shipping_rate_cart_classification_value"],
155157

156158
// Values that didn't exist yet
157-
"enable_search_index_products": tftypes.NewValue(tftypes.Bool, tftypes.UnknownValue),
158-
"enable_search_index_orders": tftypes.NewValue(tftypes.Bool, tftypes.UnknownValue),
159-
"business_units": valueToList(nil, "business_units"),
159+
"enable_search_index_products": tftypes.NewValue(tftypes.Bool, tftypes.UnknownValue),
160+
"enable_search_index_product_search": tftypes.NewValue(tftypes.Bool, tftypes.UnknownValue),
161+
"enable_search_index_orders": tftypes.NewValue(tftypes.Bool, tftypes.UnknownValue),
162+
"enable_search_index_customers": tftypes.NewValue(tftypes.Bool, tftypes.UnknownValue),
163+
"business_units": valueToList(nil, "business_units"),
160164
}),
161165
)
162166
if err != nil {

internal/resources/project/upgrade_v1_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ func Test_upgradeStateV0(t *testing.T) {
6363
Countries: []types.String{},
6464
Languages: []types.String{types.StringValue("nl")},
6565

66-
EnableSearchIndexProducts: types.BoolUnknown(),
67-
EnableSearchIndexOrders: types.BoolUnknown(),
68-
BusinessUnits: []BusinessUnits{},
66+
EnableSearchIndexProducts: types.BoolUnknown(),
67+
EnableSearchIndexProductSearch: types.BoolUnknown(),
68+
EnableSearchIndexOrders: types.BoolUnknown(),
69+
EnableSearchIndexCustomers: types.BoolUnknown(),
70+
BusinessUnits: []BusinessUnits{},
6971

7072
ExternalOAuth: []ExternalOAuth{},
7173
Carts: []Carts{

0 commit comments

Comments
 (0)