Skip to content

Commit

Permalink
misc: Remove deprecated fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Jul 9, 2024
1 parent 59a7cd6 commit 9cfa205
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 121 deletions.
2 changes: 0 additions & 2 deletions billable_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type BillableMetricInput struct {
Recurring bool `json:"recurring,omitempty"`
FieldName string `json:"field_name"`
WeightedInterval WeightedInterval `json:"weighted_interval,omitempty"`
Group map[string]interface{} `json:"group,omitempty"`
Filters []BillableMetricFilter `json:"filters,omitempty"`
}

Expand Down Expand Up @@ -72,7 +71,6 @@ type BillableMetric struct {
FieldName string `json:"field_name"`
CreatedAt time.Time `json:"created_at,omitempty"`
WeightedInterval *WeightedInterval `json:"weighted_interval,omitempty"`
Group map[string]interface{} `json:"group,omitempty"`
Filters []BillableMetricFilter `json:"filters,omitempty"`
ActiveSubscriptionsCount int `json:"active_subscriptions_count,omitempty"`
DraftInvoicesCount int `json:"draft_invoices_count,omitempty"`
Expand Down
7 changes: 0 additions & 7 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ type Charge struct {
Prorated bool `json:"prorated,omitempty"`
MinAmountCents int `json:"min_amount_cents,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
GroupProperties []GroupProperties `json:"group_properties,omitempty"`
Filters []ChargeFilter `json:"filters,omitempty"`

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

type GroupProperties struct {
GroupID uuid.UUID `json:"group_id"`
Values map[string]interface{} `json:"values"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
}
5 changes: 2 additions & 3 deletions coupon.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ type AppliedCoupon struct {
AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`

ExpirationDate string `json:"expiration_date,omitempty"`
ExpirationAt time.Time `json:"expiration_at,omitempty"`
TerminatedAt time.Time `json:"terminated_at,omitempty"`
ExpirationAt time.Time `json:"expiration_at,omitempty"`
TerminatedAt time.Time `json:"terminated_at,omitempty"`

PercentageRate float64 `json:"percentage_rate,omitempty,string"`
Frequency CouponFrequency `json:"frequency,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions credit_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ type CreditNote struct {
UpdatedAt time.Time `json:"updated_at,omitempty"`

Items []CreditNoteItem `json:"items,omitempty"`

// Deprecated: Will be removed in the future
TotalAmountCurrency Currency `json:"total_amount_currency,omitempty"`
CreditAmountCurrency Currency `json:"credit_amount_currency,omitempty"`
BalanceAmountCurrency Currency `json:"balance_amount_currency,omitempty"`
RefundAmountCurrency Currency `json:"refund_amount_currency,omitempty"`
VatAmountCents int `json:"vat_amount_cents,omitempty"`
VatAmountCurrency Currency `json:"vat_amount_currency,omitempty"`
SubTotalVatExcludedAmountCents int `json:"sub_total_vat_excluded_amount_cents,omitempty"`
SubTotalVatExcludedAmountCurrency Currency `json:"sub_total_vat_excluded_amount_currency,omitempty"`
}

type CreditNoteEstimated struct {
Expand Down
11 changes: 0 additions & 11 deletions customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,10 @@ type CustomerChargeUsage struct {

Charge *Charge `json:"charge,omitempty"`
BillableMetric *BillableMetric `json:"billable_metric,omitempty"`
Groups []CustomerChargeGroupdUsage `json:"groups,omitempty"`
Filters []CustomerChargeFilterUsage `json:"filters,omitempty"`
GroupedUsage []CustomerChargeGroupedUsage `json:"grouped_usage,omitempty"`
}

type CustomerChargeGroupdUsage struct {
LagoId string `json:"lago_id,omitempty"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
AmountCents int `json:"amount_cents,omitempty"`
EventsCount int `json:"events_count,omitempty"`
Units string `json:"units,omitempty"`
}

type CustomerChargeFilterUsage struct {
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Values map[string]interface{} `json:"value,omitempty"`
Expand All @@ -176,7 +166,6 @@ type CustomerChargeGroupedUsage struct {
EventsCount int `json:"events_count,omitempty"`
Units string `json:"units,omitempty"`
GroupedBy map[string]interface{} `json:"grouped_by,omitempty"`
Groups []CustomerChargeGroupdUsage `json:"groups,omitempty"`
Filters []CustomerChargeFilterUsage `json:"filters,omitempty"`
}

Expand Down
3 changes: 0 additions & 3 deletions fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ type FeeItem struct {
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
GroupInvoiceDisplayName string `json:"group_invoice_display_name,omitempty"`
FilterInvoiceDisplayName string `json:"filter_invoice_display_name,omitempty"`
Filters map[string]interface{} `json:"filters,omitempty"`
LagoItemID uuid.UUID `json:"lago_item_id,omitempty"`
Expand All @@ -104,7 +103,6 @@ type FeeAppliedTax struct {

type Fee struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoGroupID uuid.UUID `json:"lago_group_id,omitempty"`
LagoChargeFilterID uuid.UUID `json:"lago_charge_filter_id,omitempty"`
LagoInvoiceID uuid.UUID `json:"lago_invoice_id,omitempty"`
LagoTrueUpFeeID uuid.UUID `json:"lago_true_up_fee_id,omitempty"`
Expand All @@ -113,7 +111,6 @@ type Fee struct {

AmountCents int `json:"amount_cents,omitempty"`
AmountDetails map[string]interface{} `json:"amount_details,omitempty"`
UnitAmountCents int `json:"unit_amount_cents,omitempty"` // deprecated
PreciseUnitAmount string `json:"precise_unit_amount,omitempty"`
AmountCurrency string `json:"amount_currency,omitempty"`
TaxesAmountCents int `json:"taxes_amount_cents,omitempty"`
Expand Down
67 changes: 0 additions & 67 deletions group.go

This file was deleted.

16 changes: 2 additions & 14 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ type InvoiceCredit struct {

Invoice InvoiceSummary `json:"invoice,omitempty"`

LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoItemID uuid.UUID `json:"lago_item_id,omitempty"`
AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`
BeforeVAT bool `json:"before_vat,omitempty"`
BeforeTaxes bool `json:"before_taxes,omitempty"`
}

type InvoiceAppliedTax struct {
Expand Down Expand Up @@ -178,18 +178,6 @@ type Invoice struct {
Fees []Fee `json:"fees,omitempty"`
Credits []InvoiceCredit `json:"credits,omitempty"`
AppliedTaxes []InvoiceAppliedTax `json:"applied_taxes,omitempty"`

// Deprecated: Will be removed in the future
Legacy bool `json:"legacy,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`
AmountCents int `json:"amount_cents,omitempty"`
CreditAmountCents int `json:"credit_amount_cents,omitempty"`
CreditAmountCurrency Currency `json:"credit_amount_currency,omitempty"`
TotalAmountCurrency Currency `json:"total_amount_currency,omitempty"`
VatAmountCents int `json:"vat_amount_cents,omitempty"`
VatAmountCurrency Currency `json:"vat_amount_currency,omitempty"`
SubTotalVatExcludedAmountCents int `json:"sub_total_vat_excluded_amount_cents,omitempty"`
SubTotalVatIncludedAmountCents int `json:"sub_total_vat_included_amount_cents,omitempty"`
}

type InvoicePaymentUrl struct {
Expand Down
1 change: 0 additions & 1 deletion plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type PlanChargeInput struct {
Prorated bool `json:"prorated,omitempty"`
MinAmountCents int `json:"min_amount_cents,omitempty"`
Properties map[string]interface{} `json:"properties"`
GroupProperties []GroupProperties `json:"group_properties,omitempty"`
Filters []ChargeFilter `json:"filters,omitempty"`

TaxCodes []string `json:"tax_codes,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type ChargeOverridesInput struct {
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
MinAmountCents int `json:"min_amount_cents,omitempty"`
Properties map[string]interface{} `json:"properties"`
GroupProperties []GroupProperties `json:"group_properties,omitempty"`
Filters []ChargeFilter `json:"filters,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
}
Expand Down
3 changes: 1 addition & 2 deletions wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ type Wallet struct {
Name string `json:"name,omitempty"`
RateAmount string `json:"rate_amount,omitempty"`
CreditsBalance string `json:"credits_balance,omitempty"`
Balance string `json:"balance,omitempty"` // NOTE(legacy)
BalanceCents int `json:"balance_cents,omitempty"`
ConsumedCredits string `json:"consumed_credits,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
ExpirationDate time.Time `json:"expiration_date,omitempty"`
ExpirationAt time.Time `json:"expiration_at,omitempty"`
LastBalanceSyncAt time.Time `json:"last_balance_sync_at,omitempty"`
LastConsumedCreditAt time.Time `json:"last_consumed_credit_at,omitempty"`
TerminatedAt time.Time `json:"terminated_at,omitempty"`
Expand Down

0 comments on commit 9cfa205

Please sign in to comment.