Skip to content

Service

domain.entity.ports.service

Summary

CRUD service wiring for the entity aggregate via the hexa container.

Classes

EntityCrudsService

Bases: CrudsServiceAdaptor[Entity, EntityDocument]

Entity CRUD service resolving :class:Entity documents from a repo.

Notes

Instances are created by :func:get_entity_service. The model and schema class attributes bind the domain model and its document type.

Functions

get_entity_service

get_entity_service(repo) -> EntityCrudsService

Build an entity CRUD service wired to repo.

Parameters:

Name Type Description Default
repo Any

Mongo-backed entity repository from :func:create_entity_repo.

required

Returns:

Name Type Description
EntityCrudsService EntityCrudsService

Ready-to-use entity CRUD service.