Skip to content

Commit

Permalink
feat(grouped-by): Add new fields (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Feb 12, 2024
1 parent 4bd194e commit 679bb1d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
23 changes: 21 additions & 2 deletions customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,27 @@ type CustomerChargeUsage struct {
AmountCents int `json:"amount_cents,omitempty"`
AmountCurrency Currency `json:"amount_currency,omitempty"`

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

type CustomerChargeGroupdUsage struct {
LagoId uuid.UUID `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 CustomerChargeGroupedUsage struct {
AmountCents int `json:"amount_cents,omitempty"`
EventsCount int `json:"events_count,omitempty"`
Units string `json:"units,omitempty"`
GroupedBy map[string]interface{} `json:"grouped_by,omitempty"`
Groups []CustomerChargeGroupdUsage `json:"groups,omitempty"`
}

type CustomerUsage struct {
Expand Down
15 changes: 8 additions & 7 deletions fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ type FeeListInput struct {
}

type FeeItem struct {
Type FeeType `json:"type,omitempty"`
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"`
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"`
GroupInvoiceDisplayName string `json:"group_invoice_display_name,omitempty"`
LagoItemID uuid.UUID `json:"lago_item_id,omitempty"`
ItemType FeeItemType `json:"item_type,omitempty"`
GroupedBy map[string]interface{} `json:"grouped_by,omitempty"`
}

type FeeAppliedTax struct {
Expand Down

0 comments on commit 679bb1d

Please sign in to comment.