Skip to content

Commerce: Add promos to service #130

@erikrakuscek

Description

@erikrakuscek

Right now the logic to check promo codes is in packages/commerce/util/promo-codes.ts as a util. This logic should be part of the commerce service.

Add optional argument promos (array) to service impl, getSingleton and ContextProvider. For convenience, this can be passed in from @luxdefi/common/promos or something like that.

When we have the API to check promos we can make async getPromoFromCode and call the API from this function, for now it should just use the JSON object with promos to check if code belongs to a valid promo.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions