Skip to content

Commit

Permalink
[patch] Adding missing attributes in validate voucher response (#127)
Browse files Browse the repository at this point in the history
* fix: adding effect to voucher discount response

* fix: adding missing attributes in validate voucher response

* fix: commit changeset

* fix: changing minor to patch
  • Loading branch information
Irene350 authored Jul 27, 2022
1 parent 7b019f9 commit 7913a06
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-shirts-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@voucherify/sdk': patch
---

Improving Validate Voucher response type
2 changes: 2 additions & 0 deletions packages/sdk/src/types/DiscountVoucher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ export interface DiscountUnit {
export interface DiscountAmount {
type?: DiscountVouchersTypesEnum.AMOUNT
amount_off?: number
effect?: DiscountAmountVouchersEffectTypes
}

export interface DiscountPercent {
type?: DiscountVouchersTypesEnum.PERCENT
percent_off?: number
amount_limit?: number
effect?: DiscountPercentVouchersEffectTypes
}
2 changes: 2 additions & 0 deletions packages/sdk/src/types/Orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface OrdersItem {
quantity?: number
price?: number
amount?: number
discount_amount?: number
applied_discount_amount?: number
product?: {
override?: boolean
name?: string
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk/src/types/Validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface ValidationsValidateVoucherParams {

export interface ValidationsValidateVoucherResponse {
applicable_to?: ApplicableToResultList
inapplicable_to?: ApplicableToResultList
campaign?: string
campaign_id?: string
metadata?: Record<string, any>
Expand All @@ -54,6 +55,8 @@ export interface ValidationsValidateVoucherResponse {
total_amount: number
items?: OrdersItem[]
}
start_date?: string
expiration_date?: string
tracking_id: string
}

Expand Down

0 comments on commit 7913a06

Please sign in to comment.