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

Prevent double check-in and check-out: an example of domain logic via event-sourced aggregates #4

Open
wants to merge 1 commit into
base: feature/check-out
Choose a base branch
from

Conversation

Ocramius
Copy link
Member

This patch implements a feature (that will be specified later on, for the sake of the simplicity of the example) that prevents double check-in and checking out when not checked in.

To be kept in mind:

  1. multiple past UserCheckedIn and UserCheckedOut are possible, since the business rule is only enforced once this patch is merged, hence past state may be inconsistent with new rules. This is exactly like in typical legal systems: laws are not retroactive.
  2. multiple past UserCheckedIn and UserCheckedOut must therefore be either ignored or handled gracefully, so that future interactions do not cause awkwardness (if somebody checked in twice, for example, they shouldn't be required to check out twice, but just once)

@Ocramius Ocramius added the enhancement New feature or request label Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant