package ostate

import "github.com/tech/sendico/payments/orchestrator/internal/service/orchestrationv2/agg"

var stepTransitions = map[agg.StepState]map[agg.StepState]struct{}{
	agg.StepStateUnspecified: {
		agg.StepStatePending: {},
	},
	agg.StepStatePending: {
		agg.StepStateRunning:        {},
		agg.StepStateFailed:         {},
		agg.StepStateNeedsAttention: {},
		agg.StepStateSkipped:        {},
	},
	agg.StepStateRunning: {
		agg.StepStateCompleted:      {},
		agg.StepStateFailed:         {},
		agg.StepStateNeedsAttention: {},
	},
	agg.StepStateCompleted: {},
	agg.StepStateFailed: {
		agg.StepStateRunning:        {},
		agg.StepStateNeedsAttention: {},
	},
	agg.StepStateNeedsAttention: {
		agg.StepStateRunning:   {},
		agg.StepStateFailed:    {},
		agg.StepStateCompleted: {},
		agg.StepStateSkipped:   {},
	},
	agg.StepStateSkipped: {},
}

var stepTerminalStates = map[agg.StepState]struct{}{
	agg.StepStateCompleted: {},
	agg.StepStateSkipped:   {},
}
