What problem does it solve?
Provides a clear, consistent pattern for implementing Application Services in zoppy-api so developers can orchestrate business workflows without leaking infrastructure concerns and avoid common mistakes like reading companyId from requests or bypassing domain responsibilities.
Core Features & Use Cases
- Orchestration pattern: Standardizes the validate → persist → enqueue flow for write use cases and ensures Response DTOs are returned.
- Dependency injection & registration: Describes required constructor injections (domains, queue services, session, logService) and how to register providers and exports in ApplicationModule.
- Error handling and DTO conventions: Recommends NestJS exceptions for business errors, using response DTOs instead of entities, and when to call repositories directly.
- Use Case Example: Implement a CampaignApplication that validates feature flags, saves via CampaignDomain, enqueues a processing job, and returns a CampaignResponse DTO.
Quick Start
Create a new Application Service in src/application that validates business rules, persists via the appropriate Domain, enqueues any required jobs, returns a Response DTO, and registers the service in ApplicationModule.