43 lines
1.3 KiB
Protocol Buffer
43 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package cxcloud.common;
|
|
|
|
option go_package = "github.com/cxcloud/contracts/common";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
import "google/protobuf/struct.proto";
|
|
|
|
// Unique identifier for any entity in the system.
|
|
message EntityId {
|
|
string value = 1; // UUID v7 (time-sortable)
|
|
}
|
|
|
|
// Unified event envelope used across all layers.
|
|
message Event {
|
|
string id = 1; // UUID v7
|
|
string source = 2; // "webhook", "filesystem", "api_poll", "feedback"
|
|
string type = 3; // "customer_inquiry", "file_changed", etc.
|
|
google.protobuf.Timestamp timestamp = 4;
|
|
google.protobuf.Struct payload = 5; // Arbitrary JSON payload
|
|
map<string, string> metadata = 6; // trace_id, correlation_id, auth context
|
|
}
|
|
|
|
// Severity levels for logging and alerting.
|
|
enum Severity {
|
|
SEVERITY_UNSPECIFIED = 0;
|
|
SEVERITY_DEBUG = 1;
|
|
SEVERITY_INFO = 2;
|
|
SEVERITY_WARNING = 3;
|
|
SEVERITY_ERROR = 4;
|
|
SEVERITY_CRITICAL = 5;
|
|
}
|
|
|
|
// Health check response.
|
|
message HealthResponse {
|
|
string service = 1;
|
|
string status = 2; // "healthy", "degraded", "unhealthy"
|
|
string version = 3;
|
|
google.protobuf.Timestamp checked_at = 4;
|
|
map<string, string> dependencies = 5; // dependency -> status
|
|
}
|