Skip to content

Service

domain.tag.ports.service

Summary

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

Classes

TagCrudsService

Bases: CrudsServiceAdaptor[Tag, TagDocument]

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

Notes

Instances are created by :func:get_tag_service. The model and schema class attributes bind the domain model and its document type. An additional lookup helper get_by_names is provided.

Functions
get_by_names async
get_by_names(names: list[str])

Return tags whose names match any of the provided values.

Parameters:

Name Type Description Default
names list[str]

Tag names to look up.

required

Returns:

Name Type Description
list

Matching tag documents.

Functions

get_tag_service

get_tag_service(repo) -> TagCrudsService

Build a tag CRUD service wired to repo.

Parameters:

Name Type Description Default
repo Any

Mongo-backed tag repository from :func:create_tag_repo.

required

Returns:

Name Type Description
TagCrudsService TagCrudsService

Ready-to-use tag CRUD service.