forked from getlago/lago-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharge.go
38 lines (31 loc) · 1.36 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
package lago
import (
"time"
"github.com/google/uuid"
)
type ChargeModel string
const (
StandardChargeModel ChargeModel = "standard"
GraduatedChargeModel ChargeModel = "graduated"
PackageChargeModel ChargeModel = "package"
PercentageChargeModel ChargeModel = "percentage"
VolumeChargeModel ChargeModel = "volume"
)
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"`
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"`
Taxes []Tax `json:"tax,omitempty"`
}
type GroupProperties struct {
GroupID uuid.UUID `json:"group_id"`
Values map[string]interface{} `json:"values"`
}