-
Notifications
You must be signed in to change notification settings - Fork 17
/
charge.go
43 lines (36 loc) · 1.8 KB
/
charge.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package lago
import (
"time"
"github.com/google/uuid"
)
type ChargeModel string
const (
StandardChargeModel ChargeModel = "standard"
GraduatedChargeModel ChargeModel = "graduated"
GraduatedPercentageChargeModel ChargeModel = "graduated_percentage"
PackageChargeModel ChargeModel = "package"
PercentageChargeModel ChargeModel = "percentage"
VolumeChargeModel ChargeModel = "volume"
DynamicChargeModel ChargeModel = "dynamic"
)
type ChargeFilter struct {
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
Values map[string]interface{} `json:"values,omitempty"`
}
type Charge struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoBillableMetricID uuid.UUID `json:"lago_billable_metric_id,omitempty"`
BillableMetricCode string `json:"billable_metric_code,omitempty"`
ChargeModel ChargeModel `json:"charge_model,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
PayInAdvance bool `json:"pay_in_advance,omitempty"`
Invoiceable bool `json:"invoiceable,omitempty"`
RegroupPaidFees string `json:"regroup_paid_fees,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"`
Filters []ChargeFilter `json:"filters,omitempty"`
Taxes []Tax `json:"tax,omitempty"`
}