collab: Improve GET /billing/usage
endpoint (#29898)
This PR improves the `GET /billing/usage` endpoint. We now return the usage with the default plan limits when there is no usage record. Release Notes: - N/A
This commit is contained in:
parent
55eb0710ed
commit
45fe158bc9
2 changed files with 69 additions and 42 deletions
|
@ -61,6 +61,16 @@ pub enum SubscriptionKind {
|
|||
ZedFree,
|
||||
}
|
||||
|
||||
impl From<SubscriptionKind> for zed_llm_client::Plan {
|
||||
fn from(value: SubscriptionKind) -> Self {
|
||||
match value {
|
||||
SubscriptionKind::ZedPro => Self::ZedPro,
|
||||
SubscriptionKind::ZedProTrial => Self::ZedProTrial,
|
||||
SubscriptionKind::ZedFree => Self::Free,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The status of a Stripe subscription.
|
||||
///
|
||||
/// [Stripe docs](https://docs.stripe.com/api/subscriptions/object#subscription_object-status)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue