syntax = "proto3";

package action_mapping;

option csharp_namespace = "GeViScopeBridge.Protos";

service ActionMappingService {
  rpc GetActionMappings(GetActionMappingsRequest) returns (GetActionMappingsResponse);
  rpc GetActionMapping(GetActionMappingRequest) returns (ActionMappingResponse);
}

message GetActionMappingsRequest {
  bool enabled_only = 1;
}

message GetActionMappingRequest {
  string id = 1;
}

message ActionMapping {
  string id = 1;
  string name = 2;
  string description = 3;
  string input_action = 4;
  repeated string output_actions = 5;
  bool enabled = 6;
  int32 execution_count = 7;
  string last_executed = 8;  // ISO 8601 datetime string
  string created_at = 9;      // ISO 8601 datetime string
  string updated_at = 10;     // ISO 8601 datetime string
}

message ActionMappingResponse {
  ActionMapping mapping = 1;
}

message GetActionMappingsResponse {
  repeated ActionMapping mappings = 1;
  int32 total_count = 2;
  int32 enabled_count = 3;
  int32 disabled_count = 4;
}
