package events import ( "fmt" lucifer3 "git.aiterp.net/lucifer3/server" "git.aiterp.net/lucifer3/server/internal/gentools" "github.com/google/uuid" "strings" ) type AssignmentCreated struct { ID uuid.UUID Match string Effect lucifer3.Effect } func (e AssignmentCreated) EventDescription() string { return fmt.Sprintf("AssignmentCreated(id=%s, match=%s, effect=%s)", e.ID, e.Match, e.Effect.EffectDescription()) } type AssignmentRemoved struct { ID uuid.UUID } func (e AssignmentRemoved) EventDescription() string { return fmt.Sprintf("AssignmentRemoved(id=%s)", e.ID) } type DeviceAssigned struct { DeviceID string `json:"deviceId"` AssignmentID *uuid.UUID `json:"assignmentId"` } func (e DeviceAssigned) EventDescription() string { return fmt.Sprintf("DeviceAssigned(device=%s, %s)", e.DeviceID, e.AssignmentID) } type AssignmentVariables struct { ID uuid.UUID Map map[string]float64 } func (e AssignmentVariables) EventDescription() string { return fmt.Sprintf("AssignmentVariables(id=%s, keys=[%s])", e.ID, strings.Join(gentools.MapKeys(e.Map), ","), ) }