Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return country name in world-map endpoint #1317

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,17 @@ void should_get_active_contributors_by_country() {
[
{
"countryCode": "FR",
"countryName": "France",
"value": 2
},
{
"countryCode": "GB",
"countryName": "United Kingdom",
"value": 3
},
{
"countryCode": "MA",
"countryName": "Morocco",
"value": 2
}
]
Expand All @@ -167,14 +170,17 @@ void should_get_active_contributors_by_country_filtered_by_date() {
[
{
"countryCode": "FR",
"countryName": "France",
"value": 1
},
{
"countryCode": "GB",
"countryName": "United Kingdom",
"value": 2
},
{
"countryCode": "MA",
"countryName": "Morocco",
"value": 1
}
]
Expand All @@ -197,14 +203,17 @@ void should_get_active_contributors_by_country_filtered_by_program_or_ecosystem(
[
{
"countryCode": "FR",
"countryName": "France",
"value": 2
},
{
"countryCode": "GB",
"countryName": "United Kingdom",
"value": 3
},
{
"countryCode": "MA",
"countryName": "Morocco",
"value": 1
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12383,10 +12383,13 @@ components:
type: object
required:
- countryCode
- countryName
- value
properties:
countryCode:
$ref: '#/components/schemas/CountryCode'
countryName:
type: string
value:
type: number
format: int64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public class WorldMapKpiReadEntity {
BigDecimal value;

public BiWorldMapItemResponse toListItemResponse() {
final var country = Country.fromIso3(countryCode);
return new BiWorldMapItemResponse()
.countryCode(Country.fromIso3(countryCode).iso2Code())
.countryCode(country.iso2Code())
.countryName(country.display().orElse(country.iso2Code()))
.value(value);
}
}
Loading