3

I have an interface in domain and two string infrastructure that represent that interface. the problem is, the interface cannot initiate in mapper class so I don't know how to map entity to domain in manual mapping. I started learning senior coding so I shouldn't use switch and should consider solid concepts. The codes I wrote:
OrderDiscount is an interface in domain

discountType, discountValue are in database. These feilds should map to orderDiscount

domain:

private Order(String id,
String customerId,
List items,
Money totalPrice,
OrderDiscount discount,
OrderStatus status,
LocalDateTime createdAt,
LocalDateTime updatedAt
)
public static Order create(String customerId,
List items,
OrderDiscount discount){

LocalDateTime now = LocalDateTime.now();

Money finalPrice = calculateFinalPrice(items, discount);

return new Order(
UUID.randomUUID().toString(),
customerId,
items,
finalPrice,
discount,
OrderStatus.PENDING,
now,
now);
}
```...