Kafka - Event-Driven Architecture
In this Kafka event sourcing code, the final state is incorrect:
What is the bug?
state = 0
for event in events:
if event['type'] == 'withdrawal':
state -= event['amount']
else:
state = event['amount']What is the bug?
