Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
37
pkg/common/actionlogger/actionlogger.go
Normal file
37
pkg/common/actionlogger/actionlogger.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package actionlogger
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"fiskerinc.com/modules/common/dbbasemodel"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Use Action Log to track actions taken against a car including remote commands, car updates etc. Mostly worried about car commands for now
|
||||
type ActionLog struct {
|
||||
VIN string
|
||||
UserIdentifier string
|
||||
//UserType string // Not sure how different users can be identified between fisker customers and api admins
|
||||
Action Action // Short Hand of description
|
||||
Description string // JSON string explaining full action
|
||||
// TrackingID *uuid.UUID // If we want to log the same action as it goes through, this tracking ID will follow the same request through
|
||||
CallLocation string // Informative field where we created this. Can use runtime reflection if we want, but is more expensive
|
||||
dbbasemodel.DBModelBase
|
||||
}
|
||||
|
||||
type Action string
|
||||
|
||||
const (
|
||||
RemoteCommand Action = "RemoteCommand"
|
||||
CarConfigurationUpdate Action = "CarConfigurationUpdate"
|
||||
CarUpdate Action = "CarUpdate"
|
||||
)
|
||||
|
||||
type ActionLogFilter struct {
|
||||
VINs []string `pg:",array"`
|
||||
Actions []string `pg:",array"`
|
||||
Before time.Time
|
||||
After time.Time
|
||||
Limit int
|
||||
TrackingID *uuid.UUID
|
||||
}
|
||||
Reference in New Issue
Block a user