You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/chargeback/_dev/build/docs/README.md
+26-3Lines changed: 26 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,23 +34,46 @@ Chargeback costs are presented based on a configured rate and unit. These are us
34
34
35
35
## Configuration
36
36
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`:
38
42
39
43
```
40
44
POST chargeback_conf_lookup/_update/config
41
45
{
42
46
"doc": {
43
47
"conf_ecu_rate": 0.85,
44
48
"conf_ecu_rate_unit": "EUR",
45
-
"conf_indexing_weight": 50,
49
+
"conf_indexing_weight": 20,
46
50
"conf_query_weight": 20,
47
51
"conf_storage_weight": 40,
48
52
"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"
50
54
}
51
55
}
52
56
```
53
57
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
+
54
77
**Configuration Options:**
55
78
-`conf_ecu_rate`: The monetary value per ECU (e.g., 0.85)
56
79
-`conf_ecu_rate_unit`: The currency code (e.g., "EUR", "USD", "GBP")
0 commit comments