pub struct Subscription {Show 21 fields
pub lago_id: Uuid,
pub external_id: String,
pub lago_customer_id: Uuid,
pub external_customer_id: String,
pub billing_time: SubscriptionBillingTime,
pub name: Option<String>,
pub plan_code: String,
pub status: SubscriptionStatus,
pub created_at: DateTime<Utc>,
pub canceled_at: Option<DateTime<Utc>>,
pub started_at: Option<DateTime<Utc>>,
pub ending_at: Option<DateTime<Utc>>,
pub subscription_at: DateTime<Utc>,
pub terminated_at: Option<DateTime<Utc>>,
pub previous_plan_code: Option<String>,
pub next_plan_code: Option<String>,
pub downgrade_plan_date: Option<NaiveDate>,
pub trial_ended_at: Option<DateTime<Utc>>,
pub current_billing_period_started_at: Option<DateTime<Utc>>,
pub current_billing_period_ending_at: Option<DateTime<Utc>>,
pub plan: Option<SubscriptionPlan>,
}Expand description
Represents a subscription in the Lago billing system.
A subscription links a customer to a plan, defining their billing cycle and the charges they will be invoiced for.
Fields§
§lago_id: UuidUnique identifier for the subscription in Lago.
external_id: StringExternal unique identifier for the subscription.
lago_customer_id: UuidLago ID of the associated customer.
external_customer_id: StringExternal ID of the associated customer.
billing_time: SubscriptionBillingTimeDetermines when recurring billing cycles occur.
name: Option<String>Optional display name for the subscription.
plan_code: StringCode of the associated plan.
status: SubscriptionStatusCurrent status of the subscription.
created_at: DateTime<Utc>When the subscription was created.
canceled_at: Option<DateTime<Utc>>When the subscription was canceled (if applicable).
started_at: Option<DateTime<Utc>>When the subscription started.
ending_at: Option<DateTime<Utc>>When the subscription will end.
subscription_at: DateTime<Utc>The subscription date.
terminated_at: Option<DateTime<Utc>>When the subscription was terminated (if applicable).
previous_plan_code: Option<String>Code of the previous plan (if changed).
next_plan_code: Option<String>Code of the upcoming plan (if scheduled for change).
downgrade_plan_date: Option<NaiveDate>Date when a downgrade will take effect.
trial_ended_at: Option<DateTime<Utc>>When the trial period ended.
current_billing_period_started_at: Option<DateTime<Utc>>Start of the current billing period.
current_billing_period_ending_at: Option<DateTime<Utc>>End of the current billing period.
plan: Option<SubscriptionPlan>The associated plan details.
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more