The-Inevitable-Event-Centric-Book
The-Inevitable-Event-Centric-Book copied to clipboard
Exercise: A Unique Random Access Code
You must assign a unique access code in a (pseudo) random fashion. The range of access code at your disposal is [1 000 000, 1 999 999] The access code will be used to give you access to the system at a certain day Once an access code is used , it can not be reused for 6 months. An assigned access code, giving access in the future, may be revoked at any time. It is foreseen that up to 1 000 access codes will be used per day.
Solve this in an Event Sourced fashion. Bonus point if the assignment of the access code does not suffer from Eventual Consistency
https://github.com/johnbywater/es-example-random-access-codes