have a small Go pet/test project with DDD + CQRS + PostgreSQL in a monorepo.
There are two services:
scrapper— main service with DB/business logicbot— Telegram bot service
Current structure is roughly:
domain/
application/scrapper/
application/bot/
infra/scrapper/
infra/bot/
domain is shared for now.
The scrapper service needs to create a notification based on a domain object/event and send it to bot, and then bot sends it to the user.
The question is about the formatter that converts domain data into a message, for example a Telegram text.
I do not want to put it into bot, because I want bot to stay thin and not know the domain details of scrapper.
I’m also unsure about infra, because this formatter does not work with network/DB/external APIs directly — it only builds a message string / DTO.
application also feels not fully obvious: there are some use-case-related rules there (for example max message length), but the formatter itself is not exactly a use case.
So in a Go DDD/CQRS project, where would you usually place this kind of component?
application/scrapperinfra/scrapperseparate
contracts/presenters/notificationspackagesomewhere else
I’m looking for the most idiomatic placement in terms of DDD boundaries and service responsibilities.