Skip to content

Commit 9262914

Browse files
committed
Clarify configuration update vs add new period documentation
1 parent efaa7fc commit 9262914

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

packages/chargeback/_dev/build/docs/README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,46 @@ Chargeback costs are presented based on a configured rate and unit. These are us
3434

3535
## Configuration
3636

37-
All configuration values can be updated via the configuration lookup index:
37+
Configuration values are stored in the `chargeback_conf_lookup` index. The dashboard automatically applies the correct configuration based on the billing date falling within the `conf_start_date` and `conf_end_date` range.
38+
39+
### Update the default configuration:
40+
41+
Using `_update/config` updates the document with ID `config`:
3842

3943
```
4044
POST chargeback_conf_lookup/_update/config
4145
{
4246
"doc": {
4347
"conf_ecu_rate": 0.85,
4448
"conf_ecu_rate_unit": "EUR",
45-
"conf_indexing_weight": 50,
49+
"conf_indexing_weight": 20,
4650
"conf_query_weight": 20,
4751
"conf_storage_weight": 40,
4852
"conf_start_date": "2024-01-01T00:00:00.000Z",
49-
"conf_end_date": "2024-12-31T23:59:59.999Z"
53+
"conf_end_date": "2024-12-31T23:tie"
5054
}
5155
}
5256
```
5357

58+
### Add a new configuration period (for time-based rate changes):
59+
60+
Using `_doc` creates a new document with an auto-generated ID:
61+
62+
```
63+
POST chargeback_conf_lookup/_doc
64+
{
65+
"conf_ecu_rate": 0.95,
66+
"conf_ecu_rate_unit": "EUR",
67+
"conf_indexing_weight": 20,
68+
"conf_query_weight": 20,
69+
"conf_storage_weight": 40,
70+
"conf_start_date": "2025-01-01T00:00:00.000Z",
71+
"conf_end_date": "2025-12-31T23:59:59.999Z"
72+
}
73+
```
74+
75+
This allows you to have different rates for different time periods (e.g., quarterly or annual rate changes).
76+
5477
**Configuration Options:**
5578
- `conf_ecu_rate`: The monetary value per ECU (e.g., 0.85)
5679
- `conf_ecu_rate_unit`: The currency code (e.g., "EUR", "USD", "GBP")

0 commit comments

Comments
 (0)