Skip to content

Commit

Permalink
feat(plan_override): Add plan overrides to subscription input
Browse files Browse the repository at this point in the history
  • Loading branch information
rsempe committed Oct 11, 2023
1 parent cba7850 commit 8fe0c1c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
13 changes: 13 additions & 0 deletions lago_python_client/models/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ class ChargeResponse(BaseResponseModel):

class ChargesResponse(BaseResponseModel):
__root__: List[ChargeResponse]


class ChargeOverrides(BaseModel):
id: Optional[str]
invoice_display_name: Optional[str]
min_amount_cents: Optional[int]
properties: Optional[Dict[str, Any]]
group_properties: Optional[GroupPropertiesList]
tax_codes: Optional[List[str]]


class ChargesOverrides(BaseModel):
__root__: List[ChargeOverrides]
12 changes: 11 additions & 1 deletion lago_python_client/models/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pydantic import BaseModel

from .charge import Charges, ChargesResponse
from .charge import Charges, ChargesResponse, ChargesOverrides
from .tax import Taxes, TaxesResponse
from ..base_model import BaseResponseModel

Expand Down Expand Up @@ -39,3 +39,13 @@ class PlanResponse(BaseResponseModel):
active_subscriptions_count: int
draft_invoices_count: int
taxes: Optional[TaxesResponse]

class PlanOverrides(BaseModel):
name: Optional[str]
invoice_display_name: Optional[str]
description: Optional[str]
amount_cents: Optional[int]
amount_currency: Optional[str]
trial_period: Optional[float]
charges: Optional[ChargesOverrides]
tax_codes: Optional[List[str]]
3 changes: 2 additions & 1 deletion lago_python_client/models/subscription.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List, Optional

from pydantic import BaseModel

from .plan import PlanOverrides
from ..base_model import BaseResponseModel


Expand All @@ -13,6 +13,7 @@ class Subscription(BaseModel):
subscription_date: Optional[str]
billing_time: Optional[str]
ending_at: Optional[str]
plan_overrides: Optional[PlanOverrides]


class SubscriptionResponse(BaseResponseModel):
Expand Down

0 comments on commit 8fe0c1c

Please sign in to comment.