Skip to content

Add Dispatch State #167

@thomas-nicolai-frequenz

Description

@thomas-nicolai-frequenz

What's needed?

We need to be able to report the dispatch state.

Proposed solution

+// Enum DispatchState represents different stages of a dispatch's lifecycle, including its retrieval 
+// and execution states.
+enum DispatchState {
+  // UNKNOWN: Default status, unknown or not specified.
+  DISPATCH_STATE_UNKNOWN = 0;
+  
+  // PENDING_RETRIEVAL: Dispatch is created and waiting to be retrieved by the controller.
+  // This state is also set when an existing dispatch is updated, requiring re-retrieval to 
+  // incorporate changes.
+  DISPATCH_STATE_PENDING_RETRIEVAL = 1; 
+  
+  // RETRIEVED: Dispatch has been retrieved by the controller.
+  DISPATCH_STATE_RETRIEVED = 2;
+  
+  // STARTED: Dispatch has started execution.
+  DISPATCH_STATE_STARTED = 3;
+  
+  // COMPLETED: Dispatch has been executed and completed.
+  DISPATCH_STATE_COMPLETED = 4;
+
+  // WAITING: Dispatch is waiting to start its next scheduled execution.
+  DISPATCH_STATE_WAITING = 5;
+}

// Represents a microgrid dispatch with full details, including its ID, state and associated
// UTC timestamps.
message DispatchDetail {
  // Unique identifier of the microgrid dispatch.
  uint64 dispatch_id = 1;

  // The details of the dispatch.
  Dispatch dispatch = 2;

+  // Details of the dispatch current state.
+  DispatchState state = 3;

  // UTC Timestamp when the dispatch was created.
-  google.protobuf.Timestamp create_time = 3;
+  google.protobuf.Timestamp create_time = 4;

  // UTC Timestamp of the last update to the dispatch.
-  google.protobuf.Timestamp modification_time = 4;
+  google.protobuf.Timestamp modification_time = 5;
}

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

part:protobufAffects the protocol buffer definition filestype:enhancementNew feature or enhancement visitble to users

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions