limiter-proto/proto/limiter_range.thrift

51 lines
1.1 KiB
Thrift
Raw Normal View History

/**
* Машина хранящая временные интервалы
*/
namespace java dev.vality.limiter.range
namespace erlang limproto.range
include "proto/base.thrift"
include "proto/domain.thrift"
include "time_range.thrift"
/// Domain
typedef string LimitRangeID
typedef base.Timestamp Timestamp
struct LimitRange {
1: required LimitRangeID id
2: required time_range.TimeRangeType type
3: required Timestamp created_at
4: optional domain.CurrencySymbolicCode currency
}
struct LimitRangeState {
1: required LimitRangeID id
2: required time_range.TimeRangeType type
3: required Timestamp created_at
4: optional list<time_range.TimeRange> ranges
5: optional domain.CurrencySymbolicCode currency
}
/// 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
}