title: How to structure DTO class in a clean architecture project with parcelize?
body: <p>I'm working on an Android app in Kotlin and am trying to implement Clean Architecture with viewmodels, repositories, datasources, interfaces etc.</p>
  
  <p>Right now I have a DTO class that I'm parsing with Retrofit:</p>
  
  <pre><code>@Parcelize
  data class NewsArticleDto(
      val author: String, val title: String, val description: String,
      val url: String, val urlToImage: String, val publishedAt: String, val content: String
  ) : Parcelable
  </code></pre>
  
  <p>I would like to have an interactor called "GetNews" get the data from NewsRepository which in turn gets it from the datasource (retrofit), map it to NewsArticle entities and send a list of NewsArticles back to the viewmodel.</p>
  
  <p>The data layer is inside a different module("core"), which is a java library. The repository/interactors dont know about the DTO class since it's in the "app" module.</p>
  
  <p>The core module isn't supposed to know about the "app" module. It's also not supposed to have SDK-logic, as I understand it.</p>
  
  <p>So the problem here is that the interactor doesn't know about a DTO class and if I move it altogether to the "core" module, Android Studio can't handle the @parcelize and parcelable.</p>
  
  <p>How do I structure my project or am I overengineering things and should I leave the DTO altogether in the "app" module? If so, I still won't be able to use a "GetNews" interactor.</p>
  
  <p>This is the GetNews interactor:</p>
  
  <pre><code>class GetNews(private val newsRepository: NewsRepository) {
      suspend operator fun invoke(keyword: String, apiKey: String): Result&lt;List&lt;NewsArticle&gt;&gt; =
          try {
              newsRepository.getNews(keyword, apiKey) as Result&lt;List&lt;NewsArticle&gt;&gt;
          } catch (throwable: Throwable) {
              Result.Failure(throwable)
          }
  }
  </code></pre>
  
  <p>What I have tried:</p>
  
  <ul>
  <li><p>Moving the dto to the data layer (doesnt work due to missing dependencies)</p></li>
  <li><p>Tried solution from here: <a href="https://stackoverflow.com/questions/58395128/kotlin-1-3-50-parcelize-unresolved-reference-error">Kotlin 1.3.50 Parcelize unresolved reference error</a></p></li>
  </ul>
  
  <p>This is my project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/XG84h.png" alt="Text](https://imgur.com/eQ14M7H)[![enter image description here">]<a href="https://i.stack.imgur.com/XG84h.png" rel="nofollow noreferrer">1</a></p>
  
  <p>Any help is appreciated.</p>