Skip to content

Commit

Permalink
Fix route description in export.
Browse files Browse the repository at this point in the history
Use the name of Jore3 route direction as the source instead of route.

Resolves HSLdevcom/jore4#1604
  • Loading branch information
jarkkoka committed Dec 21, 2023
1 parent 56ee716 commit 97b88f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/resources/jore4-export/export_routes.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
SELECT
r.network_route_name AS name,
r.network_route_number AS route_number,
r.network_route_hidden_variant AS hidden_variant,
rd.network_route_direction_id AS direction_id,
rd.network_route_direction_type AS direction_type,
rd.network_route_direction_name AS name,
l.network_line_jore4_id AS line_jore4_id,
rd.network_route_direction_valid_date_range AS valid_date_range,
r.network_route_legacy_hsl_municipality_code AS legacy_hsl_municipality_code
FROM network.network_routes r
JOIN network.network_route_directions rd ON (rd.network_route_id = r.network_route_id)
JOIN network.network_lines l ON (l.network_line_id = r.network_line_id)
WHERE isempty(rd.network_route_direction_valid_date_range * '[2021-01-01, 2050-01-01)'::daterange) = false
JOIN network.network_route_directions rd USING (network_route_id)
JOIN network.network_lines l USING (network_line_id)
WHERE NOT isempty(rd.network_route_direction_valid_date_range * '[2021-01-01, 2050-01-01)'::daterange)
ORDER BY rd.network_route_direction_valid_date_range DESC
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class ExportRouteStepTest extends BatchIntegrationTest {
private final String EXPECTED_DIRECTION = Jore4RouteDirection.INBOUND.getValue();
private final UUID EXPECTED_LINE_JORE4_ID = UUID.fromString("5aa7d9fc-2cf9-466d-8ac0-f442d60c261f");
private static final String EXPECTED_LABEL = "1";
private static final String EXPECTED_DESCRIPTION = "{\"fi_FI\":\"Keskustori - Etelä-Hervanta vanha\",\"sv_SE\":\"Central torget - Södra Hervanta gamla\"}";
private static final String EXPECTED_DESCRIPTION = "{\"fi_FI\":\"Keskustori - Kaleva - Etelä-Hervanta vanha\",\"sv_SE\":\"Central torget - Kaleva - Södra Hervanta gamla\"}";
private static final int EXPECTED_PRIORITY = 10;
private static final LegacyHslMunicipalityCode EXPECTED_LEGACY_HSL_MUNICIPALITY_CODE = LegacyHslMunicipalityCode.HELSINKI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class WhenSourceTableHasOneRoute {
private final DirectionType EXPECTED_DIRECTION_TYPE = DirectionType.INBOUND;
private final UUID EXPECTED_LINE_JORE4_ID = UUID.fromString("5aa7d9fc-2cf9-466d-8ac0-f442d60c261f");
private static final String EXPECTED_ROUTE_NUMBER = "1";
private static final String EXPECTED_FINNISH_NAME = "Keskustori - Etelä-Hervanta vanha";
private static final String EXPECTED_SWEDISH_NAME = "Central torget - Södra Hervanta gamla";
private static final String EXPECTED_FINNISH_NAME = "Keskustori - Kaleva - Etelä-Hervanta vanha";
private static final String EXPECTED_SWEDISH_NAME = "Central torget - Kaleva - Södra Hervanta gamla";

private final LocalDate EXPECTED_VALID_DATE_RANGE_START = LocalDate.of(2021, 1, 1);
private final LocalDate EXPECTED_VALID_DATE_RANGE_END = LocalDate.of(2022, 1, 1);
Expand Down

0 comments on commit 97b88f8

Please sign in to comment.