title: Writing DTO Class to build object getting informations from different Data Sources
body: <p>I'm following Domain Driven Design for this project.</p>
  <p>I have got an object containing an image. Let's call it <code>Product</code>:</p>
  <pre><code>class Product {
    UniqueID id;
    ProductName name;
    ImageBytes imageBytes;
  }
  </code></pre>
  <p><code>UniqueID</code>, <code>ProductName</code> and <code>ImageBytes</code> are just validated objects that represent respectively a <code>String</code>, a <code>String</code> and a <code>List&lt;int&gt;</code>.</p>
  <p>I would like to store the actual image on Firebase Storage and saving the <code>imageId</code> on Firestore.
  So, in my idea, I have an image on Firebase Storage with id <em>xYF87Ejid0093RTcxaWpof</em> and a Doc in the Firestore containing this id instead of the actual image.</p>
  <p>The problem I'm stuck into is writing the Data Transfer Object of a Product. How should I convert an <code>imageId</code> into the actual image?</p>
  <p>Please consider that I'm using DDD, so my DTO and my Entity classes are Unions (using Freezed).</p>
  <p>I think I should have an intermediate class called <code>FirestoreProduct</code> at the Infrastructure level that looks like this:</p>
  <pre><code>class FirestoreProduct {
    UniqueID id;
    ProductName name;
    UniqueID imageId;
  }
  </code></pre>
  <p>So that I can write a DTO that uses this class instead and I can create the Product object from the repository class after I downloaded the image.
  Is there any better way to solve this problem in the DDD way?</p>
  <p>Thanks in advance.</p>