Skip to content

Commit 431dd2e

Browse files
committed
task: implement extraction of alternative price and currency during a series sale import.
Part of #1230
1 parent 16e54c8 commit 431dd2e

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

src/main/frontend/src/components/SeriesSaleImportForm.js

+8
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ class SeriesSaleImportForm extends React.Component {
6969
document.getElementById('currency').value = data.currency;
7070
}
7171

72+
if (data.altPrice) {
73+
document.getElementById('alt-price').value = data.altPrice;
74+
}
75+
76+
if (data.altCurrency) {
77+
document.getElementById('alt-currency').value = data.altCurrency;
78+
}
79+
7280
if (data.sellerId) {
7381
document.getElementById('seller').value = data.sellerId;
7482
}

src/main/java/ru/mystamps/web/feature/series/importing/sale/SeriesSaleExtractedInfo.java

+2
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ public class SeriesSaleExtractedInfo {
2828
private final Integer sellerId;
2929
private final BigDecimal price;
3030
private final String currency;
31+
private final BigDecimal altPrice;
32+
private final String altCurrency;
3133
}

src/main/java/ru/mystamps/web/feature/series/importing/sale/SeriesSalesImportServiceImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ public SeriesSaleExtractedInfo downloadAndParse(String url) {
8787
return new SeriesSaleExtractedInfo(
8888
seriesInfo.getSellerId(),
8989
seriesInfo.getPrice(),
90-
seriesInfo.getCurrency()
90+
seriesInfo.getCurrency(),
91+
seriesInfo.getAltPrice(),
92+
seriesInfo.getAltCurrency()
9193
);
9294
}
9395

src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public final class ResourceUrl {
3232
public static final String STATIC_RESOURCES_URL = "https://stamps.filezz.ru";
3333

3434
// MUST be updated when any of our resources were modified
35-
public static final String RESOURCES_VERSION = "v0.4.2.4";
35+
public static final String RESOURCES_VERSION = "v0.4.2.5";
3636

3737
// CheckStyle: ignore LineLength for next 10 lines
3838
private static final String CATALOG_UTILS_JS = "/public/js/" + RESOURCES_VERSION + "/CatalogUtils.min.js";

src/test/robotframework/series/sales/import/logic.robot

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Import a series sale with an existing seller
1818
List Selection Should Be id:seller Eicca Toppinen
1919
Textfield Value Should Be id:price 350
2020
List Selection Should Be id:currency RUB
21+
Textfield Value Should Be id:alt-price 6.3
22+
List Selection Should Be id:alt-currency EUR
2123

2224
Import a series sale without information
2325
Input Text id:series-sale-url ${MOCK_SERVER}/series/sales/import/logic/empty.html

src/test/wiremock/__files/series/sales/import/logic/existing-seller.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
</head>
77
<body>
88
Seller: <a id="test-seller" href="http://example.com/eicca-toppinen">Eicca Toppinen</a><br />
9-
Price: <span id="test-price">350</span><br />
9+
Price: <span id="test-price">350</span> (<span id="alt-price">6.3</span> <span id="alt-currency">EUR</span>)<br />
1010
</body>
1111
</html>

0 commit comments

Comments
 (0)