Skip to content

Add currency signs to /v1/currencies endpoint#6

Merged
kamaal111 merged 3 commits into
mainfrom
copilot/expand-currencies-endpoint
Mar 3, 2026
Merged

Add currency signs to /v1/currencies endpoint#6
kamaal111 merged 3 commits into
mainfrom
copilot/expand-currencies-endpoint

Conversation

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor
  • Add CurrencyInfo struct with Name and Sign fields to handlers/service.go
  • Change CurrencyNames map from map[string]string to map[string]CurrencyInfo with currency signs
  • Add Sign field to NamedSymbol struct
  • Update GetAllNamedSymbols() to include sign in response (append directly in if-ok clause)
  • Update unit tests in handlers/named_symbols_test.go to verify sign field
  • Update integration test TestGetCurrenciesEndpoint to verify sign field
  • Update README.md with updated /v1/currencies example response showing sign field
Original prompt

Expand the currencies endpoint with currency signs, for example Euro is €.
Make sure this covered by the existing integration to clearly demonstrate how this feature works.
You probably need to change the structure of the symbols map to make this work efficiently.

Once done update the README with up to date docs.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: kamaal111 <37084924+kamaal111@users.noreply.github.com>
Copilot AI changed the title [WIP] Expand currencies endpoint with currency signs Add currency signs to /v1/currencies endpoint Mar 3, 2026
@kamaal111 kamaal111 marked this pull request as ready for review March 3, 2026 03:17
Comment thread handlers/service.go Outdated
if !ok {
name = symbol
name := symbol
sign := ""

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot don't juggle with empty values just append in the if ok clause

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c3cfc8e — the loop now appends directly inside the if ok clause, removing the intermediate variables.

Co-authored-by: kamaal111 <37084924+kamaal111@users.noreply.github.com>
@kamaal111 kamaal111 merged commit 1da5b83 into main Mar 3, 2026
1 check passed
@kamaal111 kamaal111 deleted the copilot/expand-currencies-endpoint branch March 3, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants