This microservice is structured following the hexagonal architecture pattern.
The types that are relevant to the microservice.
The types that third parties (.eg database, frontend, other services) require. There should exist a mapping from models to these types.
Pure functions that convert between internal models and external schemata.
Pure functions that implement the business logic.
Impure functions with IO side effects that fetch information for the service from third parties (database, http calls, filesystem, etc). The return type of these functions should be internal models, so an adapter should be applied here.
Impure functions for controlling the flow of the application. It may call pure and other impure functions.