Project

General

Profile

Actions

Task #8

open

Domain service imports api-layer DTOs (clean-arch leak)

Added by Redmine Admin about 2 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
04/27/2026
Due date:
% Done:

0%

Estimated time:

Description

Where: src/main/kotlin/com/articon/base/domain/analytics/statistics/common/services/StatisticsService.kt:3

import com.articon.base.api.v1.analytics.statistics.dto.*

What's wrong: A class in domain/ directly depends on classes in api/v1/. Per the layering documented in CLAUDE.md (api → application → domain → infrastructure), the dependency arrow must point inward — domain must not know about api.

Why it matters: Any DTO change (rename, split, wire-format tweak) drags into the domain layer. Versioning the REST contract becomes painful, and domain tests pull api types onto the classpath unnecessarily.

Suggested fix: Define a domain-level result type under domain/analytics/statistics/...; have api/v1/.../StatisticsController map domain results to wire DTOs. The mapper belongs in api, not in domain.

No data to display

Actions

Also available in: Atom PDF