Skip to content

Commit

Permalink
feat(DynamicPricing): Expose Event#precise_total_amount_cents (#206)
Browse files Browse the repository at this point in the history
* feat(DynamicPricing): Expose Event#precise_total_amount_cents

* feat(DynamicPricing): Add dynamic charge model
  • Loading branch information
vincent-pochet authored Sep 30, 2024
1 parent 2573e16 commit 01439e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
PackageChargeModel ChargeModel = "package"
PercentageChargeModel ChargeModel = "percentage"
VolumeChargeModel ChargeModel = "volume"
DynamicChargeModel ChargeModel = "dynamic"
)

type ChargeFilter struct {
Expand Down
30 changes: 16 additions & 14 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ type BatchEventParams struct {
}

type EventInput struct {
TransactionID string `json:"transaction_id,omitempty"`
ExternalSubscriptionID string `json:"external_subscription_id,omitempty"`
Code string `json:"code,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
TransactionID string `json:"transaction_id,omitempty"`
ExternalSubscriptionID string `json:"external_subscription_id,omitempty"`
Code string `json:"code,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
PreciseTotalAmountCents string `json:"precise_total_amount_cents,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
}

type EventEstimateFeesParams struct {
Expand All @@ -47,15 +48,16 @@ type EventResult struct {
}

type Event struct {
LagoID uuid.UUID `json:"lago_id"`
TransactionID string `json:"transaction_id"`
LagoCustomerID *uuid.UUID `json:"lago_customer_id,omitempty"`
Code string `json:"code,omitempty"`
Timestamp time.Time `json:"timestamp"`
Properties map[string]interface{} `json:"properties,omitempty"`
LagoSubscriptionID *uuid.UUID `json:"lago_subscription_id,omitempty"`
ExternalSubscriptionID string `json:"external_subscription_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
LagoID uuid.UUID `json:"lago_id"`
TransactionID string `json:"transaction_id"`
LagoCustomerID *uuid.UUID `json:"lago_customer_id,omitempty"`
Code string `json:"code,omitempty"`
Timestamp time.Time `json:"timestamp"`
PreciseTotalAmountCents string `json:"precise_total_amount_cents,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
LagoSubscriptionID *uuid.UUID `json:"lago_subscription_id,omitempty"`
ExternalSubscriptionID string `json:"external_subscription_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
}

func (c *Client) Event() *EventRequest {
Expand Down

0 comments on commit 01439e1

Please sign in to comment.