Skip to content

Commit

Permalink
Merge pull request #221 from getlago/getlago/invoice_custom_sections
Browse files Browse the repository at this point in the history
Feat(invoice_custom_sections): update go-client with invoice_custom_sections
  • Loading branch information
annvelents authored Jan 14, 2025
2 parents bb9adb5 + bd63f90 commit e50b7dc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
17 changes: 16 additions & 1 deletion customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ type CustomerInput struct {
IntegrationCustomers []IntegrationCustomer `json:"integration_customers,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
FinalizeZeroAmountInvoice FinalizeZeroAmountInvoice `json:"finalize_zero_amount_invoice,omitempty"`
SkipInvoiceCustomSections bool `json:"skip_invoice_custom_sections,omitempty"`
InvoiceCustomSectionCodes []string `json:"invoice_custom_section_codes,omitempty"`
}

type CustomerListInput struct {
Expand Down Expand Up @@ -153,6 +155,17 @@ type IntegrationCustomer struct {
SyncWithProvider bool `json:"sync_with_provider,omitempty"`
}

type InvoiceCustomSection struct {
LagoId uuid.UUID `json:"lago_id,omitempty"`
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Details string `json:"details,omitempty"`
DisplayName string `json:"display_name,omitempty"`
AppliedToOrganization bool `json:"applied_to_organization,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}

type IntegrationCustomersResponse struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
ExternalCustomerId string `json:"external_customer_id,omitempty"`
Expand Down Expand Up @@ -253,8 +266,10 @@ type Customer struct {
Currency Currency `json:"currency,omitempty"`
Timezone string `json:"timezone,omitempty"`
ApplicableTimezone string `json:"applicable_timezone,omitempty"`
SkipInvoiceCustomSections bool `json:"skip_invoice_custom_sections,omitempty"`

Taxes []Tax `json:"taxes,omitempty"`
Taxes []Tax `json:"taxes,omitempty"`
ApplicableInvoiceCustomSections []InvoiceCustomSection `json:"applicable_invoice_custom_sections,omitempty"`

CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Expand Down
20 changes: 15 additions & 5 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ type InvoiceCredit struct {
BeforeTaxes bool `json:"before_taxes,omitempty"`
}

type InvoiceAppliedInvoiceCustomSection struct {
LagoId uuid.UUID `json:"lago_id,omitempty"`
LagoInvoiceId uuid.UUID `json:"lago_invoice_id,omitempty"`
Code string `json:"code,omitempty"`
Details string `json:"details,omitempty"`
DisplayName string `json:"display_name,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}

type InvoiceAppliedTax struct {
LagoId uuid.UUID `json:"lago_id,omitempty"`
LagoInvoiceId uuid.UUID `json:"lago_invoice_id,omitempty"`
Expand Down Expand Up @@ -187,11 +196,12 @@ type Invoice struct {
Customer *Customer `json:"customer,omitempty"`
Subscriptions []Subscription `json:"subscriptions,omitempty"`

Fees []Fee `json:"fees,omitempty"`
Credits []InvoiceCredit `json:"credits,omitempty"`
AppliedTaxes []InvoiceAppliedTax `json:"applied_taxes,omitempty"`
ErrorDetails []InvoiceErrorDetail `json:"error_details,omitempty"`
AppliedUsageThreshold []AppliedUsageThreshold `json:"applied_usage_threshold,omitempty"`
Fees []Fee `json:"fees,omitempty"`
Credits []InvoiceCredit `json:"credits,omitempty"`
AppliedInvoiceCustomSections []InvoiceAppliedInvoiceCustomSection `json:"applied_invoice_custom_sections,omitempty"`
AppliedTaxes []InvoiceAppliedTax `json:"applied_taxes,omitempty"`
ErrorDetails []InvoiceErrorDetail `json:"error_details,omitempty"`
AppliedUsageThreshold []AppliedUsageThreshold `json:"applied_usage_threshold,omitempty"`
}

type InvoicePaymentUrl struct {
Expand Down

0 comments on commit e50b7dc

Please sign in to comment.