-
Notifications
You must be signed in to change notification settings - Fork 6
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
Domain Modeling - Design Workflow: assign role #84
Labels
help wanted
Extra attention is needed
Comments
Commandtype AssignRoleCommand = {
playerId: string;
role: RoleCard;
} Eventtype AssignRoleEvent = {
playerId: string;
role: RoleCard;
} Errortype AssignRoleError = EventSourceWriteError Typetype AssignRole = (eventsource: EventSource, command: AssignRoleCommand) => ResultAsync<AssignRoleEvent, AssignRoleError> Workflowworkflow: assign role
input:
event source
assign role command
output:
async result of
ok -> player assign role event
err -> assign role error
step:
append event to event source
if error occured:
return event source write error
otherwise:
return assign role event |
@JohnsonMao |
Due to the adjustments in the turn start process, the "assign role" function has been modified as follows. |
type AssignRole = (eventsource: EventSource, command: AssignRoleCommand) => ResultAsync<AssignRoleEvent, AssignRoleError> |
To ensure logical validation and further completion, we would need the following additional functions:
Errortype NotEnoughPlayersError = Error & {
name: 'NotEnoughPlayersError'
message: 'Not enough players'
}
type ExceededPlayerCountError = Error & {
name: 'ExceededPlayerCountError'
message: 'Exceeded player count'
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
implement design of https://hackmd.io/KvV2Ou3HS9uN11OUpsAUzA?both#Workflow-assign-role
The text was updated successfully, but these errors were encountered: