v2: events (WIP)

Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
nfel 2025-07-14 15:21:03 +03:30
parent 7f8b4a2c5f
commit 3eac30a1e3
Signed by: nfel
GPG Key ID: DCC0BF3F92B0D45F
2 changed files with 38 additions and 16 deletions

View File

@ -2,8 +2,8 @@ syntax = "proto3";
package alert.v1;
import "base/v1/msg.proto";
import "auth/v1/msg.proto";
import "base/v1/msg.proto";
message AlertFilter {
base.v1.BaseQueryParam base_filter = 1;
@ -13,19 +13,35 @@ message AlertFilter {
// Importance of given event
enum Importance {
LOW = 0; // Low Severity ( unimportant and can be ignored )
MEDIUM = 1; // MEDIUM Severity
HIGH = 2; // High Severity
LOW = 0; // Low Severity ( unimportant and can be ignored )
MEDIUM = 1; // MEDIUM Severity
HIGH = 2; // High Severity
CRITICAL = 3; // CRITICAL Severity ( can cause panics and data lost )
}
enum LogSource {
UNKNOWN = 0;
USER = 1;
SYSTEM = 2;
WALLET = 3;
enum LogType {
TYPE_UNKNOWN = 0;
TYPE_SMS = 1;
TYPE_EMAIL = 2;
TYPE_PUSH = 3;
}
enum LogLevel {
LVL_UNKNOWN = 0;
LVL_INFO = 1;
LVL_SUCCESS = 2;
LVL_WARN = 3;
LVL_ERROR = 4;
}
enum LogSource {
SRC_UNKNOWN = 0;
SRC_USER = 1;
SRC_SYSTEM = 2;
SRC_WALLET = 3;
}
message Meta {
uint32 created_at_ts = 1;
uint32 updated_at_ts = 2;
@ -34,14 +50,17 @@ message Meta {
message LogEvent {
auth.v1.InternalIAM iam = 1;
optional uint64 id = 2; // Record Id of Log stored in db
string content = 3;
optional LogSource source = 4;
Importance importance = 5;
Meta meta = 6;
optional uint64 id = 2; // Record Id of Log stored in db
LogSource source = 3;
Importance importance = 4;
LogLevel level = 5;
string content = 6;
Meta meta = 7;
}
message LogEventList { repeated LogEvent events = 1; }
message LogEventList {
repeated LogEvent events = 1;
}
/*
Internal Msg
*/
@ -59,4 +78,6 @@ message SMS {
repeated SMSChangeLog change_log = 5;
}
message SMSList { repeated SMS sms = 1; }
message SMSList {
repeated SMS sms = 1;
}

View File

@ -11,3 +11,4 @@ service AlertSrv {
// rpc Update(LogEvent) returns (base.v1.StatusRes) {}
// rpc Get(AlertFilter) returns (base.v1.StatusRes) {}
}