Add ports and service for product affinity functionality

This commit is contained in:
Jesus Navalon
2026-07-11 18:26:22 +02:00
parent 54208ba87f
commit 5dd4c7c2a1
4 changed files with 44 additions and 0 deletions
@@ -0,0 +1,11 @@
package com.example.productaffinity.domain.port.incomming;
import com.example.productaffinity.domain.model.Product;
import reactor.core.publisher.Mono;
import java.util.List;
// Input Port for resolving similar products to a requested product
public interface GetAffinityProductsUC {
Mono<List<Product>> getAffinityProducts(String productId);
}
@@ -0,0 +1,4 @@
package com.example.productaffinity.domain.port.outcoming;
public class AffinityProductsIdsPort {
}
@@ -0,0 +1,9 @@
package com.example.productaffinity.domain.port.outcoming;
import reactor.core.publisher.Mono;
import java.util.Collection;
public interface ProductDetailsPort {
Mono<Collection<String>> findAffinityProductIds(String productId);
}
@@ -0,0 +1,20 @@
package com.example.productaffinity.domain.service;
import com.example.productaffinity.domain.model.Product;
import com.example.productaffinity.domain.port.incomming.GetAffinityProductsUC;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
import java.util.List;
@Service
public class SimilarProductsService implements GetAffinityProductsUC {
public SimilarProductsService() {
}
@Override
public Mono<List<Product>> getAffinityProducts(String productId) {
return null;
}
}