Skip to content

Commit 10a859c

Browse files
Make recurrence count and end time mutually exclusive
Signed-off-by: Stefan Brus <[email protected]>
1 parent f8bd509 commit 10a859c

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
## Upgrading
88

99
- Queries that compare against a time interval filter should check for the end time inside the recurrence rule.
10+
- `end_time` has been renamed `until` and is mutually exclusive with `count`.
1011

1112
## New Features
1213

13-
- Moved the field `end_time` to inside the recurrence rule object.
1414
- Introduced a new field `duration`.
1515

1616
## Bug Fixes

proto/frequenz/api/dispatch/v1/dispatch.proto

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,19 @@ message RecurrenceRule {
219219
FREQUENCY_MONTHLY = 5;
220220
}
221221

222+
// Controls when a recurring dispatch should end
223+
message EndCriteria {
224+
oneof count_or_until {
225+
// The number of times this dispatch should recur.
226+
// If this field is set, the dispatch will recur the given number of times.
227+
uint32 count = 1;
228+
229+
// The end time of this dispatch in UTC.
230+
// If this field is set, the dispatch will recur until the given timestamp.
231+
google.protobuf.Timestamp until = 2;
232+
}
233+
}
234+
222235
// The frequency specifier of this recurring dispatch
223236
Frequency freq = 1;
224237

@@ -229,9 +242,10 @@ message RecurrenceRule {
229242
// interval = 2
230243
uint32 interval = 2;
231244

232-
// (Optional) limit the number of occurences
233-
// If this field is not set, the dispatch will recur indefinitely
234-
optional uint32 count = 3;
245+
// When this dispatch should end.
246+
// A dispatch can either recur a fixed number of times, or until a given timestamp.
247+
// If this field is not set, the dispatch will recur indefinitely.bool
248+
EndCriteria end_criteria = 3;
235249

236250
// On which minute(s) of the hour does the event occur
237251
repeated uint32 byminutes = 4;
@@ -247,9 +261,6 @@ message RecurrenceRule {
247261

248262
// On which month(s) of the year does the event occur
249263
repeated uint32 bymonths = 8;
250-
251-
// The end time in UTC
252-
google.protobuf.Timestamp end_time = 9;
253264
}
254265

255266
// Message for listing dispatches for a given microgrid, and an optional filter

0 commit comments

Comments
 (0)