@@ -17,7 +17,6 @@ typedef base.CurrencySymbolicCode CurrencySymbolicCode
1717
1818struct LimitConfigParams {
1919 1: required LimitConfigID id
20- 2: required LimitBodyType body_type
2120 3: required Timestamp started_at
2221 4: required ShardSize shard_size
2322 5: required time_range.TimeRangeType time_range_type
@@ -32,7 +31,6 @@ struct LimitConfig {
3231 1: required LimitConfigID id
3332 2: required string processor_type
3433 3: required Timestamp created_at
35- 4: required LimitBodyType body_type
3634 5: required Timestamp started_at
3735 6: required ShardSize shard_size
3836 7: required time_range.TimeRangeType time_range_type
@@ -41,6 +39,9 @@ struct LimitConfig {
4139 9: optional LimitScope scope
4240 10: optional string description
4341 12: optional OperationLimitBehaviour op_behaviour
42+
43+ // deprecated
44+ 4: optional LimitBodyType body_type_deprecated
4445}
4546
4647struct OperationLimitBehaviour {
@@ -55,22 +56,38 @@ union OperationBehaviour {
5556struct Subtraction {}
5657struct Addition {}
5758
58- union LimitBodyType {
59- 1: LimitBodyTypeAmount amount
60- 2: LimitBodyTypeCash cash
59+ union LimitType {
60+ 1: LimitTypeTurnover turnover
6161}
6262
63- struct LimitBodyTypeAmount {}
64- struct LimitBodyTypeCash {
65- 1: required CurrencySymbolicCode currency
63+ struct LimitTypeTurnover {
64+ /**
65+ * Metric to account turnover with.
66+ * If undefined, equivalent to specifying `LimitTurnoverNumber`.
67+ */
68+ 1: optional LimitTurnoverMetric metric
6669}
6770
71+ union LimitTurnoverMetric {
72+
73+ /**
74+ * Measure turnover over number of operations.
75+ */
76+ 1: LimitTurnoverNumber number
77+
78+ /**
79+ * Measure turnover over aggregate amount of operations denominated in a single currency.
80+ * In the event operation's currency differs from limit's currency operation will be accounted
81+ * with appropriate exchange rate fixed against operation's timestamp.
82+ */
83+ 2: LimitTurnoverAmount amount
6884
69- union LimitType {
70- 1: LimitTypeTurnover turnover
7185}
7286
73- struct LimitTypeTurnover {}
87+ struct LimitTurnoverNumber {}
88+ struct LimitTurnoverAmount {
89+ 1: required CurrencySymbolicCode currency
90+ }
7491
7592union LimitScope {
7693
@@ -134,3 +151,13 @@ union Change {
134151struct CreatedChange {
135152 1: required LimitConfig limit_config
136153}
154+
155+ // / Deprecated definitions
156+
157+ union LimitBodyType {
158+ 2: LimitBodyTypeCash cash
159+ }
160+
161+ struct LimitBodyTypeCash {
162+ 1: required CurrencySymbolicCode currency
163+ }
0 commit comments