Closed Bug 991496 Opened 10 years ago Closed 10 years ago

Make an external constants library

Categories

(Marketplace Graveyard :: Code Quality, defect, P5)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: andy+bugzilla, Assigned: andy+bugzilla)

Details

We've got constants from zamboni that we need to share in webpay, solitude and maybe fireplace and who knows where else. These include things like country codes, mcc info, region ids etc.

Ideally we'll change all our API's not to use magic numbers, but in the meantime, it would be nice if we could just import marketplace.constants and get access to them.

Some examples:

https://github.com/mozilla/fireplace/blob/master/hearth/media/js/mobilenetwork.js#L10
https://github.com/mozilla/zamboni/blob/master/mkt/constants/regions.py#L70
https://github.com/mozilla/webpay/blob/master/lib/marketplace/constants.py#L5

https://github.com/mozilla/solitude/blob/master/lib/transactions/constants.py#L49
https://github.com/mozilla/zamboni/blob/master/apps/constants/payments.py#L121

..,you get the idea. 

Extra props if this is just one module, that is a pile of JSON and can be pulled in from require.js or imported in python as needed. We won't get everything, but we could get a bunch of this duplication removed.
Priority: -- → P5
Assignee: nobody → amckay
https://github.com/andymckay/marketplace-constants lives and is being used by zamboni. There's a lot more it could do, but its a start.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.