Consider making constants for currencies
I see "USD" in many places… there may be others… we should consider what the strategy is for enum-like constants and use it for this.
I personally like https://github.com/abice/go-enum as a generated enum, which has json/yaml marshaling and the ability to add your own template additions from the structured awareness of the enum metadata.
- See https://github.com/prebid/prebid-server/pull/4076#discussion_r1905973463
Interesting idea @scr-oath . We discussed in committee but we're thinking that since USD is the only currency mentioned in the codebase it doesn't make sense to add an enum for any more. And there's concern about the switching back and forth of enums to strings for currencies.
Any followup thoughts?
USD is used by many bidders, or they internally convert non-USD to $. No extra package is needed. The string 'USD' can be defined as a constant in the internal PBS package, and other modules can import it
There is no clear benefit from doing this apart from cleaner code, but there will be an issue that newly submitted bidder adapters might continue to use old style. Which will create a split in codebase style.
But generally if someone from the community want to implement this, both Go and Java will be glad to aссept the submission.