(title: string)
| 77 | const executeCreateTodo = (title: string) => TodoAggregateRoot.commands.createTodo(title)(); |
| 78 | |
| 79 | const createTodo = (title: string) => { |
| 80 | const todoId = `todo-${Date.now()}` as TodoId; |
| 81 | const state = TodoAggregateRoot.new(); |
| 82 | |
| 83 | return pipe( |
| 84 | title, |
| 85 | executeCreateTodo, |
| 86 | Effect.flatMap(commitAndReturnId(todoId, state.nextEventNumber, title)) |
| 87 | ); |
| 88 | }; |
| 89 | |
| 90 | const processCommand = ( |
| 91 | todoState: Readonly<Option.Option<TodoState>>, |
no test coverage detected