feat: add audit event domain type and service interface
This commit is contained in:
21
internal/domain/audit.go
Normal file
21
internal/domain/audit.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package domain
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AuditEvent struct {
|
||||||
|
UserID string
|
||||||
|
Action string
|
||||||
|
ResourceType string
|
||||||
|
ResourceID string
|
||||||
|
MetadataJSON json.RawMessage
|
||||||
|
IP string
|
||||||
|
UserAgent string
|
||||||
|
}
|
||||||
|
|
||||||
|
type AuditService interface {
|
||||||
|
Record(ctx context.Context, event AuditEvent) error
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user