-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Expose billing periods with invoice object
- Loading branch information
1 parent
e50b7dc
commit 2bd253b
Showing
2 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package lago | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/google/uuid" | ||
) | ||
|
||
type InvoicingReason string | ||
|
||
const ( | ||
BillingPeriodSubscriptionStarting InvoicingReason = "subscription_starting" | ||
BillingPeriodSubscriptionPeriodic InvoicingReason = "subscription_periodic" | ||
BillingPeriodSubscriptionTerminating InvoicingReason = "subscription_terminating" | ||
BillingPeriodSInAdvanceCharge InvoicingReason = "in_advance_charge" | ||
BillingPeriodInAdvanceChargePeriodic InvoicingReason = "in_advance_charge_periodic" | ||
BillingPeriodSProgressiveBilling InvoicingReason = "progressive_billing" | ||
) | ||
|
||
type BillingPeriod struct { | ||
LagoSubscriptionId uuid.UUID `json:"lago_subscription_id"` | ||
ExternalSubscriptionId string `json:"external_subscription_id"` | ||
SubscriptionFromDatetime time.Time `json:"subscription_from_datetime"` | ||
SubscriptionToDatetime time.Time `json:"subscription_to_datetime"` | ||
ChargesFromDatetime time.Time `json:"charges_from_datetime"` | ||
ChargesToDatetime time.Time `json:"charges_to_datetime"` | ||
InvoicingReason InvoicingReason `json:"invoicing_reason"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters