-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathfixed_charge.go
More file actions
90 lines (77 loc) · 3.61 KB
/
Copy pathfixed_charge.go
File metadata and controls
90 lines (77 loc) · 3.61 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package lago
import (
"time"
"github.com/google/uuid"
)
type FixedChargeModel string
const (
StandardFixedChargeModel FixedChargeModel = "standard"
GraduatedFixedChargeModel FixedChargeModel = "graduated"
VolumeFixedChargeModel FixedChargeModel = "volume"
)
type GraduatedRange struct {
FromValue int `json:"from_value"`
ToValue *int `json:"to_value"`
FlatAmount string `json:"flat_amount,omitempty"`
PerUnitAmount string `json:"per_unit_amount,omitempty"`
}
type VolumeRange struct {
FromValue int `json:"from_value"`
ToValue *int `json:"to_value"`
FlatAmount string `json:"flat_amount,omitempty"`
PerUnitAmount string `json:"per_unit_amount,omitempty"`
}
type FixedChargeProperties struct {
Amount *string `json:"amount,omitempty"`
GraduatedRanges []GraduatedRange `json:"graduated_ranges,omitempty"`
VolumeRanges []VolumeRange `json:"volume_ranges,omitempty"`
}
type FixedCharge struct {
LagoID uuid.UUID `json:"lago_id"`
LagoAddOnID uuid.UUID `json:"lago_add_on_id"`
InvoiceDisplayName string `json:"invoice_display_name"`
AddOnCode string `json:"add_on_code"`
CreatedAt time.Time `json:"created_at"`
Code string `json:"code,omitempty"`
ChargeModel FixedChargeModel `json:"charge_model"`
PayInAdvance bool `json:"pay_in_advance"`
Prorated bool `json:"prorated"`
Properties *FixedChargeProperties `json:"properties"`
Units float64 `json:"units"`
LagoParentID *uuid.UUID `json:"lago_parent_id,omitempty"`
Taxes []Tax `json:"taxes,omitempty"`
}
type FixedChargeInput struct {
LagoID *uuid.UUID `json:"id,omitempty"`
AddOnID uuid.UUID `json:"add_on_id,omitempty"`
ChargeModel FixedChargeModel `json:"charge_model,omitempty"`
Code string `json:"code,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Units float64 `json:"units"`
PayInAdvance bool `json:"pay_in_advance"`
Prorated bool `json:"prorated"`
Properties *FixedChargeProperties `json:"properties,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
ApplyUnitsImmediately bool `json:"apply_units_immediately,omitempty"`
CascadeUpdates *bool `json:"cascade_updates,omitempty"`
}
type FixedChargeOverridesInput struct {
ID *uuid.UUID `json:"id,omitempty"`
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
Units *float64 `json:"units,omitempty"`
ApplyUnitsImmediately bool `json:"apply_units_immediately,omitempty"`
Properties *FixedChargeProperties `json:"properties,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
}
type FixedChargeParams struct {
FixedCharge *FixedChargeInput `json:"fixed_charge"`
}
type FixedChargeResult struct {
FixedCharge *FixedCharge `json:"fixed_charge,omitempty"`
FixedCharges []FixedCharge `json:"fixed_charges,omitempty"`
Meta Metadata `json:"meta,omitempty"`
}
type FixedChargeListInput struct {
PerPage int `json:"per_page,omitempty,string"`
Page int `json:"page,omitempty,string"`
}