small code improvements
This commit is contained in:
@@ -8,8 +8,8 @@ public class DemandService {
|
||||
|
||||
private final ProductDemandRepository repository;
|
||||
|
||||
public void init(String refNo) {
|
||||
repository.initDemandsFor(refNo);
|
||||
public void initNewProduct(String refNo) {
|
||||
repository.initNewProduct(refNo);
|
||||
}
|
||||
|
||||
public void process(Document document) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import pl.com.bottega.factory.product.management.RefNoId;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -16,11 +15,11 @@ import java.util.Map;
|
||||
class ProductDemand {
|
||||
|
||||
final RefNoId id;
|
||||
final Demands demands;
|
||||
final List<DailyDemand.DemandUpdated> updates = new ArrayList<>();
|
||||
final List<DailyDemand.DemandUpdated> updates;
|
||||
private final Demands demands;
|
||||
|
||||
final Clock clock;
|
||||
final DemandEvents events;
|
||||
private final Clock clock;
|
||||
private final DemandEvents events;
|
||||
|
||||
interface Demands {
|
||||
DailyDemand get(LocalDate date);
|
||||
|
||||
@@ -5,5 +5,5 @@ interface ProductDemandRepository {
|
||||
|
||||
void save(ProductDemand model);
|
||||
|
||||
void initDemandsFor(String refNo);
|
||||
void initNewProduct(String refNo);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class ProductDemandBuilder {
|
||||
}
|
||||
|
||||
def build() {
|
||||
new ProductDemand(new RefNoId(refNo), demands, clock, events)
|
||||
new ProductDemand(new RefNoId(refNo), new ArrayList<>(), demands, clock, events)
|
||||
}
|
||||
|
||||
def document(LocalDate date, long ... levels) {
|
||||
|
||||
Reference in New Issue
Block a user