File tree 3 files changed +10
-1
lines changed
java/ru/mystamps/web/feature/series
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 20
20
import lombok .Getter ;
21
21
import lombok .RequiredArgsConstructor ;
22
22
import ru .mystamps .web .common .Currency ;
23
+ import ru .mystamps .web .feature .series .sale .SeriesCondition ;
23
24
24
25
import java .math .BigDecimal ;
25
26
import java .util .Date ;
@@ -41,4 +42,5 @@ public class PurchaseAndSaleDto {
41
42
private final Currency firstCurrency ;
42
43
private final BigDecimal secondPrice ;
43
44
private final Currency secondCurrency ;
45
+ private final SeriesCondition condition ;
44
46
}
Original file line number Diff line number Diff line change 20
20
import ru .mystamps .web .common .Currency ;
21
21
import ru .mystamps .web .common .JdbcUtils ;
22
22
import ru .mystamps .web .common .LinkEntityDto ;
23
+ import ru .mystamps .web .feature .series .sale .SeriesCondition ;
23
24
24
25
import java .math .BigDecimal ;
25
26
import java .sql .ResultSet ;
@@ -98,6 +99,10 @@ private RowMappers() {
98
99
BigDecimal secondPrice = rs .getBigDecimal ("second_price" );
99
100
Currency secondCurrency = JdbcUtils .getCurrency (rs , "second_currency" );
100
101
102
+ // LATER: consider extracting this into a helper method
103
+ String conditionField = rs .getString ("condition" );
104
+ SeriesCondition condition = rs .wasNull () ? null : SeriesCondition .valueOf (conditionField );
105
+
101
106
return new PurchaseAndSaleDto (
102
107
date ,
103
108
sellerName ,
@@ -108,7 +113,8 @@ private RowMappers() {
108
113
firstPrice ,
109
114
firstCurrency ,
110
115
secondPrice ,
111
- secondCurrency
116
+ secondCurrency ,
117
+ condition
112
118
);
113
119
}
114
120
Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ series.find_purchases_and_sales_by_series_id = \
183
183
, first_currency \
184
184
, second_price \
185
185
, second_currency \
186
+ , condition \
186
187
FROM series_sales ss \
187
188
JOIN transaction_participants seller \
188
189
ON seller.id = ss.seller_id \
You can’t perform that action at this time.
0 commit comments