Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create country state machine config #8

Closed
wants to merge 4 commits into from

Conversation

Panos68
Copy link

@Panos68 Panos68 commented Jan 10, 2025

creating a country state machine to be implemented by services to be able to determine fsm depending on a country

Comment on lines +5 to +10
interface CountryStateMachineConfig<S : Any, E : Any> {
val country: CountryCode
val enabled: Boolean
val transitions: List<CountryEdge<S, E>>
val initialState: S
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this library is extremely generic, so I would avoid introducing references to the business logic. Instead, I’d suggest introducing something like a descriptor field to characterize the state machine configuration

Suggested change
interface CountryStateMachineConfig<S : Any, E : Any> {
val country: CountryCode
val enabled: Boolean
val transitions: List<CountryEdge<S, E>>
val initialState: S
}
interface StateMachineConfig<D: Any, S : Any, E : Any> {
val descriptor: D
val enabled: Boolean
val transitions: List<Edge<S, E>>
val initialState: S
}

@Panos68
Copy link
Author

Panos68 commented Jan 13, 2025

decided that is better to work without central interfaces given that we will have more unique cases based on the service

@Panos68 Panos68 closed this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants