2021-04-29 09:00:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* Машина хранящая временные интервалы
|
|
|
|
|
*/
|
|
|
|
|
|
2022-01-15 13:10:35 +00:00
|
|
|
|
namespace java dev.vality.limiter.range
|
2022-06-23 11:32:58 +00:00
|
|
|
|
namespace erlang limproto.range
|
2021-04-29 09:00:46 +00:00
|
|
|
|
|
2022-06-14 12:53:59 +00:00
|
|
|
|
include "proto/base.thrift"
|
|
|
|
|
include "proto/domain.thrift"
|
2021-04-29 09:00:46 +00:00
|
|
|
|
include "time_range.thrift"
|
|
|
|
|
|
|
|
|
|
/// Domain
|
|
|
|
|
|
2022-06-14 12:53:59 +00:00
|
|
|
|
typedef string LimitRangeID
|
2021-04-29 09:00:46 +00:00
|
|
|
|
typedef base.Timestamp Timestamp
|
|
|
|
|
|
|
|
|
|
struct LimitRange {
|
|
|
|
|
1: required LimitRangeID id
|
|
|
|
|
2: required time_range.TimeRangeType type
|
|
|
|
|
3: required Timestamp created_at
|
2022-06-14 12:53:59 +00:00
|
|
|
|
4: optional domain.CurrencySymbolicCode currency
|
2021-04-29 09:00:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct LimitRangeState {
|
|
|
|
|
1: required LimitRangeID id
|
|
|
|
|
2: required time_range.TimeRangeType type
|
|
|
|
|
3: required Timestamp created_at
|
|
|
|
|
4: optional list<time_range.TimeRange> ranges
|
2022-06-14 12:53:59 +00:00
|
|
|
|
5: optional domain.CurrencySymbolicCode currency
|
2021-04-29 09:00:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// LimitRange events
|
|
|
|
|
|
|
|
|
|
struct TimestampedChange {
|
|
|
|
|
1: required base.Timestamp occured_at
|
|
|
|
|
2: required Change change
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union Change {
|
|
|
|
|
1: CreatedChange created
|
|
|
|
|
2: TimeRangeCreatedChange time_range_created
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CreatedChange {
|
|
|
|
|
1: required LimitRange limit_range
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TimeRangeCreatedChange {
|
|
|
|
|
1: required time_range.TimeRange time_range
|
|
|
|
|
}
|