Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
p-zielinski committed Oct 4, 2023
1 parent c02c902 commit 2149c93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .changeset/tidy-comics-tall.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

Add support for 3 missing endpoints in loyalties api. Corrected a typo in one of loyalties api method.
- Added support for new endpoints: `GET /loyalties/{campaignId}/earning-rules/{earningRuleId}`, `POST /loyalties/{campaignId}/earning-rules/{earningRuleId}/enable` and `POST /loyalties/{campaignId}/earning-rules/{earningRuleId}/disable` [(examples available in readme.md)](..%2F..%2Fpackages%2Fsdk%2FREADME.md)



- New exported types/interfaces: `LoyaltiesGetEarningRuleResponseBody`, `LoyaltiesEnableEarningRulesResponseBody`, `LoyaltiesDisableEarningRulesResponseBody`, `EarningRuleEvent`, `EarningRuleBase`, `EarningRuleLoyaltyFixed`, `EarningRuleLoyaltyProportionalOrder`, `EarningRuleLoyaltyProportionalOrderAmount`, `EarningRuleLoyaltyProportionalOrderTotalAmount`, `EarningRuleLoyaltyProportionalOrderMetadata`, `EarningRuleLoyaltyProportionalOrderItems`, `EarningRuleLoyaltyProportionalOrderItemsQuantity`, `EarningRuleLoyaltyProportionalOrderItemsAmount`, `EarningRuleLoyaltyProportionalOrderItemsSubtotalAmount`, `EarningRuleLoyaltyProportionalCustomer`, `EarningRuleLoyaltyProportionalCustomEvent`, `EarningRuleLoyaltyProportional`
20 changes: 10 additions & 10 deletions packages/sdk/src/types/Loyalties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,6 @@ export type LoyaltiesDisableEarningRulesResponseBody = EarningRuleBase & {
}

// Domain types

export type EarningRuleEvent =
| 'order.paid'
| 'customer.segment.entered'
| 'custom_event'
| 'customer.loyalty.tier.upgraded'
| 'customer.loyalty.tier.downgraded'
| 'customer.loyalty.tier.prolonged'
| 'customer.loyalty.tier.joined'
| 'customer.loyalty.tier.left'
export interface EarningRuleBase {
id: string
created_at: string
Expand Down Expand Up @@ -558,6 +548,16 @@ export interface EarningRuleBase {
metadata: Record<string, any>
}

export type EarningRuleEvent =
| 'order.paid'
| 'customer.segment.entered'
| 'custom_event'
| 'customer.loyalty.tier.upgraded'
| 'customer.loyalty.tier.downgraded'
| 'customer.loyalty.tier.prolonged'
| 'customer.loyalty.tier.joined'
| 'customer.loyalty.tier.left'

export interface EarningRuleLoyaltyFixed {
type: 'FIXED'
points: number
Expand Down

0 comments on commit 2149c93

Please sign in to comment.