-
Notifications
You must be signed in to change notification settings - Fork 274
/
DemandService.java
31 lines (24 loc) · 884 Bytes
/
DemandService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package io.dddbyexamples.factory.demand.forecasting;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public class DemandService {
private final ProductDemandRepository repository;
public void initNewProduct(String refNo) {
repository.initNewProduct(refNo);
}
public void process(Document document) {
ProductDemand model = repository.get(document.getRefNo());
model.process(document);
repository.save(model);
}
public void adjust(AdjustDemand adjustDemand) {
ProductDemand model = repository.get(adjustDemand.getRefNo());
model.adjust(adjustDemand);
repository.save(model);
}
public void review(ApplyReviewDecision reviewDecision) {
ProductDemand model = repository.get(reviewDecision.getRefNo());
model.review(reviewDecision);
repository.save(model);
}
}