Skip to content

Commit

Permalink
feat(invoice_display_name): Add invoice display name (#127)
Browse files Browse the repository at this point in the history
* feat(invoice_display_name): Add invoice display name

* feat(invoice_display_name): Fix Charge struct

* feat(invoice_display_name): Add omitempty to InvoiceDisplayName

* feat(invoice_display_name): Add omitempty to InvoiceDisplayName for charge, fee

---------

Co-authored-by: Ivan Novosad <[email protected]>
  • Loading branch information
ivannovosad and Ivan Novosad authored Oct 5, 2023
1 parent 434c760 commit 6a228c6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 30 deletions.
16 changes: 9 additions & 7 deletions add_on.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ type AddOnParams struct {
}

type AddOnInput struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`

AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`
Expand All @@ -40,10 +41,11 @@ type AddOnResult struct {
}

type AddOn struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`
LagoID uuid.UUID `json:"lago_id,omitempty"`
Name string `json:"name,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Code string `json:"code,omitempty"`
Description string `json:"description,omitempty"`

AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Charge struct {
CreatedAt time.Time `json:"created_at,omitempty"`
PayInAdvance bool `json:"pay_in_advance,omitempty"`
Invoiceable bool `json:"invoiceable,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Prorated bool `json:"prorated,omitempty"`
MinAmountCents int `json:"min_amount_cents,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
Expand All @@ -34,6 +35,7 @@ type Charge struct {
}

type GroupProperties struct {
GroupID uuid.UUID `json:"group_id"`
Values map[string]interface{} `json:"values"`
GroupID uuid.UUID `json:"group_id"`
Values map[string]interface{} `json:"values"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
}
12 changes: 7 additions & 5 deletions fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ type FeeListInput struct {
}

type FeeItem struct {
Type FeeType `json:"type,omitempty"`
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
LagoItemID uuid.UUID `json:"lago_item_id,omitempty"`
ItemType FeeItemType `json:"item_type,omitempty"`
Type FeeType `json:"type,omitempty"`
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
LagoItemID uuid.UUID `json:"lago_item_id,omitempty"`
ItemType FeeItemType `json:"item_type,omitempty"`
}

type FeeAppliedTax struct {
Expand Down Expand Up @@ -116,6 +117,7 @@ type Fee struct {
Invoiceable bool `json:"invoiceable,omitempty"`
FromDate string `json:"from_date,omitempty"`
ToDate string `json:"to_date,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`

Units string `json:"units,omitempty"`
Description string `json:"description,omitempty"`
Expand Down
11 changes: 6 additions & 5 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ 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"`
TaxCodes []string `json:"tax_codes,omitempty"`
AddOnCode string `json:"add_on_code,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,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
24 changes: 13 additions & 11 deletions plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ type PlanChargeInput struct {
}

type PlanInput struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Interval PlanInterval `json:"interval,omitempty"`
Description string `json:"description,omitempty"`
AmountCents int `json:"amount_cents"`
AmountCurrency Currency `json:"amount_currency,omitempty"`
PayInAdvance bool `json:"pay_in_advance"`
BillChargeMonthly bool `json:"bill_charge_monthly"`
TrialPeriod float32 `json:"trial_period"`
Charges []PlanChargeInput `json:"charges,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
Name string `json:"name,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Code string `json:"code,omitempty"`
Interval PlanInterval `json:"interval,omitempty"`
Description string `json:"description,omitempty"`
AmountCents int `json:"amount_cents"`
AmountCurrency Currency `json:"amount_currency,omitempty"`
PayInAdvance bool `json:"pay_in_advance"`
BillChargeMonthly bool `json:"bill_charge_monthly"`
TrialPeriod float32 `json:"trial_period"`
Charges []PlanChargeInput `json:"charges,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
}

type PlanListInput struct {
Expand All @@ -68,6 +69,7 @@ type PlanListInput struct {
type Plan struct {
LagoID uuid.UUID `json:"lago_id"`
Name string `json:"name,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Code string `json:"code,omitempty"`
Interval PlanInterval `json:"interval,omitempty"`
Description string `json:"description,omitempty"`
Expand Down

0 comments on commit 6a228c6

Please sign in to comment.