Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.

[RFC] Discount getters#407

Open
andrzejewsky wants to merge 2 commits into
masterfrom
discountGetters
Open

[RFC] Discount getters#407
andrzejewsky wants to merge 2 commits into
masterfrom
discountGetters

Conversation

@andrzejewsky
Copy link
Copy Markdown
Collaborator

  • I'm confirming that if i made any changes to public APIs or exposed any public APIs they are doccumented.

getDiscountedTotals: () => AgnosticTotals;
getDiscountName: () => string;
getDiscountValue: () => number;
getDiscountType: () => string; // fixed or percentage
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's not necessary

getDiscountId: () => string;
getDiscountedTotals: () => AgnosticTotals;
getDiscountName: () => string;
getDiscountValue: () => number;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should return string eg "-15%" "-20 złotych"

Also I'm thinking about separated getters, which has even more sense as you can have multiple discounts applied to the cart.

```ts
export interface DiscountGetters {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can be different between platforms

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants