small code improvements

This commit is contained in:
Michał Michaluk
2018-02-18 23:14:01 +01:00
parent 8e9e3a1ca9
commit f1132df0a3
8 changed files with 12 additions and 24 deletions

View File

@@ -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) {

View File

@@ -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);

View File

@@ -5,5 +5,5 @@ interface ProductDemandRepository {
void save(ProductDemand model);
void initDemandsFor(String refNo);
void initNewProduct(String refNo);
}

View File

@@ -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) {