Skip to content

Commit 39ff832

Browse files
committed
Modify stock retrieval, to include the given date
1 parent 2bea8e0 commit 39ff832

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/app/service/impl/StockServiceImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package app.service.impl;
22

3+
import app.common.utils.DateUtils;
34
import app.projection.StockProjection;
45
import app.repository.WareTransactionDetailRepository;
56
import app.service.StockService;
@@ -19,9 +20,13 @@ public StockServiceImpl(WareTransactionDetailRepository wareTransactionDetailRep
1920
this.wareTransactionDetailRepository = wareTransactionDetailRepository;
2021
}
2122

23+
/**
24+
* Returns a stock snapshot of a product, until the given date.
25+
* Including the given date.
26+
*/
2227
@Override
2328
public List<StockProjection> findStockByProductAndDate(String productCode, Date date) {
2429
return this.wareTransactionDetailRepository
25-
.findStockByProductAndDate(productCode, date);
30+
.findStockByProductAndDate(productCode, DateUtils.plusDays(date, 1));
2631
}
2732
}

0 commit comments

Comments
 (0)