Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def construct_entity_persistence_policy(self):
if self.entity_event_store:
return PersistencePolicy(
event_store=self.entity_event_store,
event_type=VersionedEntity.Event,
)
def construct_persistence_policy(self) -> None:
self._persistence_policy = PersistencePolicy(
event_store=self.event_store, persist_event_type=self.persist_event_type
)
def construct_snapshot_persistence_policy(self):
if self.snapshot_event_store:
return PersistencePolicy(
event_store=self.snapshot_event_store,
event_type=Snapshot,
)
def construct_log_persistence_policy(self):
if self.log_event_store:
return PersistencePolicy(
event_store=self.log_event_store,
event_type=Logged,
)
def construct_snapshot_persistence_policy(self):
if self.snapshot_event_store:
return PersistencePolicy(
event_store=self.snapshot_event_store, persist_event_type=Snapshot
)
def construct_entity_persistence_policy(self):
if self.entity_event_store:
return PersistencePolicy(
event_store=self.entity_event_store,
persist_event_type=VersionedEntity.Event,
)