refactor(scum): remove legacy projection workflows
This commit is contained in:
@@ -1,185 +0,0 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type SCUMProjectionSubject string
|
||||
|
||||
const (
|
||||
SCUMProjectionSubjectPlayer SCUMProjectionSubject = "player"
|
||||
SCUMProjectionSubjectLiveState SCUMProjectionSubject = "player-live-state"
|
||||
SCUMProjectionSubjectSquad SCUMProjectionSubject = "squad"
|
||||
SCUMProjectionSubjectMember SCUMProjectionSubject = "squad-member"
|
||||
SCUMProjectionSubjectVehicle SCUMProjectionSubject = "vehicle"
|
||||
SCUMProjectionSubjectFlag SCUMProjectionSubject = "flag"
|
||||
SCUMProjectionSubjectPosition SCUMProjectionSubject = "position"
|
||||
)
|
||||
|
||||
type SCUMProjectionFilter struct {
|
||||
ServerInstanceID string
|
||||
GamePlayerID string
|
||||
GamePlayerRecordID string
|
||||
UserProfileID string
|
||||
SteamID string
|
||||
SquadID string
|
||||
VehicleID string
|
||||
FlagID string
|
||||
SubjectType SCUMProjectionSubject
|
||||
QueryKey string
|
||||
Freshness SCUMProjectionFreshness
|
||||
Search string
|
||||
Limit int
|
||||
}
|
||||
|
||||
type SCUMPlayerLiveState struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
GamePlayerRecordID string
|
||||
GamePlayerID string
|
||||
UserProfileID string
|
||||
SteamID string
|
||||
DisplayName string
|
||||
SquadID string
|
||||
SquadName string
|
||||
Online bool
|
||||
FamePoints float64
|
||||
NormalBalance float64
|
||||
GoldBalance float64
|
||||
LastLoginAt time.Time
|
||||
LastLogoutAt time.Time
|
||||
LastSaveTime time.Time
|
||||
Position SCUMCurrentPosition
|
||||
UnknownFields map[string]any
|
||||
Freshness SCUMProjectionFreshnessState
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMSquad struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
SquadID string
|
||||
Name string
|
||||
LeaderProfileID string
|
||||
LeaderPlayerID string
|
||||
MemberCount int
|
||||
Score float64
|
||||
UnknownFields map[string]any
|
||||
Freshness SCUMProjectionFreshnessState
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMSquadMember struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
SquadID string
|
||||
UserProfileID string
|
||||
GamePlayerRecordID string
|
||||
GamePlayerID string
|
||||
SteamID string
|
||||
DisplayName string
|
||||
Rank string
|
||||
IsLeader bool
|
||||
JoinedAt time.Time
|
||||
UnknownFields map[string]any
|
||||
Freshness SCUMProjectionFreshnessState
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMVehicle struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
VehicleID string
|
||||
EntityID string
|
||||
ClassName string
|
||||
Label string
|
||||
OwnerProfileID string
|
||||
OwnerPlayerID string
|
||||
SquadID string
|
||||
Position SCUMCurrentPosition
|
||||
UnknownFields map[string]any
|
||||
Freshness SCUMProjectionFreshnessState
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMFlag struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
FlagID string
|
||||
EntityID string
|
||||
OwnerProfileID string
|
||||
OwnerPlayerID string
|
||||
OwnerSquadID string
|
||||
OwnerSquadName string
|
||||
OwnershipConfidence string
|
||||
Position SCUMCurrentPosition
|
||||
UnknownFields map[string]any
|
||||
Freshness SCUMProjectionFreshnessState
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMCurrentPosition struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
SubjectType SCUMProjectionSubject
|
||||
SubjectID string
|
||||
GamePlayerRecordID string
|
||||
GamePlayerID string
|
||||
VehicleID string
|
||||
EntityID string
|
||||
MapID string
|
||||
MapVersion string
|
||||
X float64
|
||||
Y float64
|
||||
Z float64
|
||||
HasCoordinates bool
|
||||
LastSaveTime time.Time
|
||||
Freshness SCUMProjectionFreshnessState
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func SCUMProjectionStateUnknown() SCUMProjectionFreshnessState {
|
||||
return SCUMProjectionFreshnessState{Status: SCUMProjectionUnknown}
|
||||
}
|
||||
|
||||
func CopySCUMPlayerLiveState(value SCUMPlayerLiveState) SCUMPlayerLiveState {
|
||||
value.Position = CopySCUMCurrentPosition(value.Position)
|
||||
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
|
||||
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMSquad(value SCUMSquad) SCUMSquad {
|
||||
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
|
||||
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMSquadMember(value SCUMSquadMember) SCUMSquadMember {
|
||||
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
|
||||
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMVehicle(value SCUMVehicle) SCUMVehicle {
|
||||
value.Position = CopySCUMCurrentPosition(value.Position)
|
||||
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
|
||||
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMFlag(value SCUMFlag) SCUMFlag {
|
||||
value.Position = CopySCUMCurrentPosition(value.Position)
|
||||
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
|
||||
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMCurrentPosition(value SCUMCurrentPosition) SCUMCurrentPosition {
|
||||
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
|
||||
return value
|
||||
}
|
||||
@@ -1,282 +0,0 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type SCUMObservationStatus string
|
||||
|
||||
const (
|
||||
SCUMObservationAccepted SCUMObservationStatus = "accepted"
|
||||
SCUMObservationStale SCUMObservationStatus = "stale"
|
||||
SCUMObservationFailed SCUMObservationStatus = "failed"
|
||||
)
|
||||
|
||||
type SCUMProjectionFreshness string
|
||||
|
||||
const (
|
||||
SCUMProjectionFresh SCUMProjectionFreshness = "fresh"
|
||||
SCUMProjectionStale SCUMProjectionFreshness = "stale"
|
||||
SCUMProjectionUnknown SCUMProjectionFreshness = "unknown"
|
||||
)
|
||||
|
||||
type SCUMWorkflowStatus string
|
||||
|
||||
const (
|
||||
SCUMWorkflowDraft SCUMWorkflowStatus = "draft"
|
||||
SCUMWorkflowQueued SCUMWorkflowStatus = "queued"
|
||||
SCUMWorkflowRunning SCUMWorkflowStatus = "running"
|
||||
SCUMWorkflowWaiting SCUMWorkflowStatus = "waiting"
|
||||
SCUMWorkflowBlocked SCUMWorkflowStatus = "blocked"
|
||||
SCUMWorkflowConfirming SCUMWorkflowStatus = "confirming"
|
||||
SCUMWorkflowConfirmed SCUMWorkflowStatus = "confirmed"
|
||||
SCUMWorkflowFailed SCUMWorkflowStatus = "failed"
|
||||
SCUMWorkflowUnknown SCUMWorkflowStatus = "unknown"
|
||||
SCUMWorkflowCancelled SCUMWorkflowStatus = "cancelled"
|
||||
)
|
||||
|
||||
type SCUMWorkflowStepStatus string
|
||||
|
||||
const (
|
||||
SCUMWorkflowStepQueued SCUMWorkflowStepStatus = "queued"
|
||||
SCUMWorkflowStepRunning SCUMWorkflowStepStatus = "running"
|
||||
SCUMWorkflowStepWaiting SCUMWorkflowStepStatus = "waiting"
|
||||
SCUMWorkflowStepBlocked SCUMWorkflowStepStatus = "blocked"
|
||||
SCUMWorkflowStepConfirming SCUMWorkflowStepStatus = "confirming"
|
||||
SCUMWorkflowStepConfirmed SCUMWorkflowStepStatus = "confirmed"
|
||||
SCUMWorkflowStepFailed SCUMWorkflowStepStatus = "failed"
|
||||
SCUMWorkflowStepUnknown SCUMWorkflowStepStatus = "unknown"
|
||||
SCUMWorkflowStepCancelled SCUMWorkflowStepStatus = "cancelled"
|
||||
)
|
||||
|
||||
type SCUMSafeSummary struct {
|
||||
Title string
|
||||
Message string
|
||||
Details map[string]string
|
||||
}
|
||||
|
||||
type SCUMDataObservation struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
Source string
|
||||
QueryKey string
|
||||
SubjectType string
|
||||
SubjectID string
|
||||
Sequence uint64
|
||||
Checksum string
|
||||
Status SCUMObservationStatus
|
||||
ErrorCode string
|
||||
SafeSummary SCUMSafeSummary
|
||||
ObservedAt time.Time
|
||||
ReceivedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMObservationResult struct {
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
Source string
|
||||
QueryKey string
|
||||
Sequence uint64
|
||||
Checksum string
|
||||
Status SCUMObservationStatus
|
||||
ErrorCode string
|
||||
SafeSummary SCUMSafeSummary
|
||||
ObservedAt time.Time
|
||||
ReceivedAt time.Time
|
||||
Rows []map[string]any
|
||||
}
|
||||
|
||||
type SCUMProjectionFreshnessState struct {
|
||||
Status SCUMProjectionFreshness
|
||||
ObservationID string
|
||||
Source string
|
||||
QueryKey string
|
||||
Sequence uint64
|
||||
Checksum string
|
||||
StaleReason string
|
||||
ObservedAt time.Time
|
||||
ReceivedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMMutationGuard struct {
|
||||
FieldKey string
|
||||
Before any
|
||||
After any
|
||||
MaxRowsAffected int
|
||||
SafetyWindow string
|
||||
BackupRef string
|
||||
RequiresOfflinePlayer bool
|
||||
RequiresMaintenance bool
|
||||
RequiresBackup bool
|
||||
}
|
||||
|
||||
type SCUMOperationConfirmation struct {
|
||||
Status string
|
||||
ObservationID string
|
||||
ConfirmedFields map[string]any
|
||||
AffectedRows int
|
||||
MutationChecksum string
|
||||
Checksum string
|
||||
ObservedAt time.Time
|
||||
SafeSummary SCUMSafeSummary
|
||||
}
|
||||
|
||||
type SCUMOperationRequest struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
TemplateKey string
|
||||
PlayerID string
|
||||
RequesterID string
|
||||
ApproverID string
|
||||
ApprovalLevel GameClientBridgeApprovalLevel
|
||||
Payload map[string]any
|
||||
Guard SCUMMutationGuard
|
||||
Confirmation SCUMOperationConfirmation
|
||||
Status SCUMWorkflowStepStatus
|
||||
Reason string
|
||||
IdempotencyKey string
|
||||
RunJobID string
|
||||
SafeSummary SCUMSafeSummary
|
||||
AuditReferences []string
|
||||
CreatedAt time.Time
|
||||
ApprovedAt time.Time
|
||||
CompletedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMOperationRequestFilter struct {
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
TemplateKey string
|
||||
PlayerID string
|
||||
RequesterID string
|
||||
Status SCUMWorkflowStepStatus
|
||||
IdempotencyKey string
|
||||
Limit int
|
||||
}
|
||||
|
||||
type SCUMWorkflowInstanceFilter struct {
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
TemplateKey string
|
||||
RequestedBy string
|
||||
Status SCUMWorkflowStatus
|
||||
IdempotencyKey string
|
||||
Limit int
|
||||
}
|
||||
|
||||
type SCUMWorkflowStepFilter struct {
|
||||
WorkflowID string
|
||||
ServerInstanceID string
|
||||
StepKey string
|
||||
Status SCUMWorkflowStepStatus
|
||||
MutatesState *bool
|
||||
Limit int
|
||||
}
|
||||
|
||||
type SCUMWorkflowInstance struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
TemplateKey string
|
||||
RequestedBy string
|
||||
IdempotencyKey string
|
||||
Status SCUMWorkflowStatus
|
||||
CurrentStepKey string
|
||||
Input map[string]any
|
||||
SafeSummary SCUMSafeSummary
|
||||
BlockerReason string
|
||||
AuditReferences []string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
CompletedAt time.Time
|
||||
}
|
||||
|
||||
type SCUMWorkflowStep struct {
|
||||
ID string
|
||||
WorkflowID string
|
||||
ServerInstanceID string
|
||||
StepKey string
|
||||
DependsOn []string
|
||||
Status SCUMWorkflowStepStatus
|
||||
OperationKey string
|
||||
QueryTemplateKey string
|
||||
Capability string
|
||||
TargetKey string
|
||||
JobID string
|
||||
Attempt int
|
||||
MaxAttempts int
|
||||
MutatesState bool
|
||||
Confirmation SCUMOperationConfirmation
|
||||
SafeSummary SCUMSafeSummary
|
||||
BlockerReason string
|
||||
AuditReferences []string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
CompletedAt time.Time
|
||||
}
|
||||
|
||||
func CopySCUMSafeSummary(value SCUMSafeSummary) SCUMSafeSummary {
|
||||
value.Details = CopyStringMap(value.Details)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMDataObservation(value SCUMDataObservation) SCUMDataObservation {
|
||||
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMObservationResult(value SCUMObservationResult) SCUMObservationResult {
|
||||
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
|
||||
value.Rows = CopyGameClientBridgeRows(value.Rows)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopyGameClientBridgeRows(values []map[string]any) []map[string]any {
|
||||
if values == nil {
|
||||
return nil
|
||||
}
|
||||
out := make([]map[string]any, len(values))
|
||||
for index, row := range values {
|
||||
out[index] = CopyGameClientBridgePayload(row)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func CopySCUMProjectionFreshnessState(value SCUMProjectionFreshnessState) SCUMProjectionFreshnessState {
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMMutationGuard(value SCUMMutationGuard) SCUMMutationGuard {
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMOperationConfirmation(value SCUMOperationConfirmation) SCUMOperationConfirmation {
|
||||
value.ConfirmedFields = CopyGameClientBridgePayload(value.ConfirmedFields)
|
||||
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMOperationRequest(value SCUMOperationRequest) SCUMOperationRequest {
|
||||
value.Payload = CopyGameClientBridgePayload(value.Payload)
|
||||
value.Guard = CopySCUMMutationGuard(value.Guard)
|
||||
value.Confirmation = CopySCUMOperationConfirmation(value.Confirmation)
|
||||
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
|
||||
value.AuditReferences = CopyStringSlice(value.AuditReferences)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMWorkflowInstance(value SCUMWorkflowInstance) SCUMWorkflowInstance {
|
||||
value.Input = CopyGameClientBridgePayload(value.Input)
|
||||
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
|
||||
value.AuditReferences = CopyStringSlice(value.AuditReferences)
|
||||
return value
|
||||
}
|
||||
|
||||
func CopySCUMWorkflowStep(value SCUMWorkflowStep) SCUMWorkflowStep {
|
||||
value.DependsOn = CopyStringSlice(value.DependsOn)
|
||||
value.Confirmation = CopySCUMOperationConfirmation(value.Confirmation)
|
||||
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
|
||||
value.AuditReferences = CopyStringSlice(value.AuditReferences)
|
||||
return value
|
||||
}
|
||||
Reference in New Issue
Block a user