-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move AggregateKeyNotUniqueError to Sequent::Core namespace
- Loading branch information
1 parent
9aa5cc9
commit 545d7f1
Showing
3 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,26 @@ def to_s | |
"#{self.class.name}: #{@id}" | ||
end | ||
|
||
# Some aggregates represent a unique external entity (e.g. a | ||
# user's email address or login name) and this uniqueness needs | ||
# to be enforced. For each unique key the returned object should | ||
# have an entry where the key of the entry describes the scope | ||
# of the constraint (e.g. `user_email` or `login_name`) and the | ||
# value represents the unique value. Values can be any JSON | ||
# value (string, object, array, etc). Note that uniqueness is | ||
# enforced across all aggregate types if the same scope is used. | ||
# | ||
# An `AggregateKeyNotUniqueError` is raised if a unique | ||
# constrained is violated when committing the events to the | ||
# database. | ||
# | ||
# Sample return value: | ||
# | ||
# ``` | ||
# { | ||
# user_email: { email: '[email protected]' } | ||
# } | ||
# ``` | ||
def unique_keys | ||
{} | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters