Skip to content

Commit 074ba8c

Browse files
BG-753: [limiter] Introduces limit finalization behaviour (#203)
* BG-753: [limiter] Introduces limit finalization behaviour * Adds payment session route condition * Simplifies limit finalization behaviour * Update proto/limiter_config.thrift Co-authored-by: OtherCool <212906794+OtherCool@users.noreply.github.com> * Cleans up --------- Co-authored-by: OtherCool <212906794+OtherCool@users.noreply.github.com>
1 parent dfd6648 commit 074ba8c

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

proto/limiter_config.thrift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ struct TimeRangeTypeInterval {
2929
}
3030

3131
struct LimitConfig {
32+
/**
33+
* Available values:
34+
* "TurnoverProcessor" - regular turnover processor
35+
* FIXME Maybe migrate to enum or union and softly deprecate string field
36+
*/
3237
1: required string processor_type
3338
2: required base.Timestamp started_at
3439
3: required ShardSize shard_size
@@ -47,6 +52,13 @@ struct LimitConfig {
4752
* limiter-proto).
4853
*/
4954
10: optional CurrencyConversion currency_conversion
55+
/**
56+
* Specifies behavior for metric change finalization.
57+
*
58+
* Defaults to normal: commits provided changes, and reverts them on
59+
* rollback.
60+
*/
61+
11: optional LimitFinalizationBehaviour finalization_behaviour
5062
}
5163

5264
struct CurrencyConversion {}
@@ -145,3 +157,14 @@ union OperationBehaviour {
145157

146158
struct Subtraction {}
147159
struct Addition {}
160+
161+
union LimitFinalizationBehaviour {
162+
1: Normal normal
163+
2: ContextDependent invertable
164+
}
165+
166+
struct Normal {}
167+
struct Inversed {}
168+
union ContextDependent {
169+
1: Inversed session_presence
170+
}

0 commit comments

Comments
 (0)