You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having type information available for elements like Aggregates, Entities, and Events is invaluable. While this works in most cases, some edge scenarios need to be handled:
Type information for elements subclassing an abstract base element, like HoldExpired and HoldPlaced event classes below:
@lending.event(part_of="Patron", abstract=True)
class HoldEvent:
patron_id = Identifier(required=True)
patron_type = String(required=True)
hold_id = Identifier(required=True)
branch_id = Identifier(required=True)
book_id = Identifier(required=True)
hold_type = String(required=True)
requested_at = DateTime(required=True)
expires_on = Date()
@lending.event(part_of="Patron")
class HoldExpired(HoldEvent):
"""Event raised when a hold on a book placed by a patron expires"""
@lending.event(part_of="Patron")
class HoldPlaced(HoldEvent):
"""Event raised when a book is placed on hold"""
Auto-generated fields like id and attributes/shadow fields backing associations and value objects
Special fields like HasMany and ValueObject that are connected to other elements have to be annotated with the proper types and attributse
The text was updated successfully, but these errors were encountered:
Having type information available for elements like Aggregates, Entities, and Events is invaluable. While this works in most cases, some edge scenarios need to be handled:
Type information for elements subclassing an abstract base element, like
HoldExpired
andHoldPlaced
event classes below:Auto-generated fields like
id
and attributes/shadow fields backing associations and value objectsSpecial fields like
HasMany
andValueObject
that are connected to other elements have to be annotated with the proper types and attributseThe text was updated successfully, but these errors were encountered: