Skip to content

Commit

Permalink
feat(tax): Add taxes to add ons (#114)
Browse files Browse the repository at this point in the history
* feat(tax): Add taxes to add ons

* feat(tax): Add add_ons_count to tax

* feat(tax): Add tax_codes to one-off invoice
  • Loading branch information
rsempe authored Aug 14, 2023
1 parent befae5c commit 518e96c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions add_on.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type AddOnInput struct {

AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`

TaxCodes []string `json:"tax_codes,omitempty"`
}

type AddOnListInput struct {
Expand All @@ -46,6 +48,8 @@ type AddOn struct {
AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`

Taxes []Tax `json:"tax,omitempty"`

CreatedAt time.Time `json:"created_at,omitempty"`
}

Expand Down
11 changes: 6 additions & 5 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ type InvoiceMetadataInput struct {
}

type InvoiceFeesInput struct {
AddOnCode string `json:"add_on_code,omitempty"`
UnitAmountCents int `json:"unit_amount_cents,omitempty"`
Description string `json:"description,omitempty"`
Units float32 `json:"units,omitempty"`
AddOnCode string `json:"add_on_code,omitempty"`
UnitAmountCents int `json:"unit_amount_cents,omitempty"`
Description string `json:"description,omitempty"`
Units float32 `json:"units,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
}

type InvoiceMetadataResponse struct {
Expand Down Expand Up @@ -156,7 +157,7 @@ type Invoice struct {
SubTotalIncludingTaxesAmountCents int `json:"sub_total_including_taxes_amount_cents,omitempty"`
TotalAmountCents int `json:"total_amount_cents,omitempty"`
PrepaidCreditAmountCents int `json:"prepaid_credit_amount_cents,omitempty"`
NetPaymentTerm int `json:"net_payment_term,omitempty"`
NetPaymentTerm int `json:"net_payment_term,omitempty"`

FileURL string `json:"file_url,omitempty"`
Metadata []InvoiceMetadataResponse `json:"metadata,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions tax.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Tax struct {
Code string `json:"code,omitempty"`
Rate float32 `json:"rate,omitempty"`
Description string `json:"description,omitempty"`
AddOnsCount int `json:"add_ons_count,omitempty"`
CustomersCount int `json:"customers_count,omitempty"`
PlansCount int `json:"plans_count,omitempty"`
ChargesCount int `json:"charges_count,omitempty"`
Expand Down

0 comments on commit 518e96c

Please sign in to comment.