Skip to content

Commit

Permalink
add subscription struct (#33)
Browse files Browse the repository at this point in the history
* add subscription struct

* fix import (cuz no goimports invoked)

* omg

* omg v2

* no pointer

* add subscription in team

* add payment strcut
  • Loading branch information
palage4a authored Aug 31, 2021
1 parent 29e3f64 commit 783eff8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions payment.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package tdproto

type Payment struct {
TariffUid string `json:"tariff_uid"`
TeamUid string `json:"team_uid"`
UserUid string `json:"user_uid"`
ConfirmationUrl string `json:"confirmation_url"`
}
19 changes: 19 additions & 0 deletions subscription.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package tdproto

import "time"

// Subscription - an entity that signifies the fact
// of subscribing to the tariff of any team for a certain period
// (not defined, in the case of the default tariff)
type Subscription struct {
// Subscription id
Uid string `json:"uid"`
// Subscription activation time
Activated *time.Time `json:"activated,omitempty"`
// Subscription expiration time
Expires *time.Time `json:"expires,omitempty"`
// ID of the tariff for which the subscription is valid
TariffUid string `json:"tariff_uid,omitempty"`
// ID of the user who subscribed
UserUid string `json:"user_uid,omitempty"`
}
3 changes: 3 additions & 0 deletions team.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ type Team struct {

// Team's available tariff by includig archive ones
AvailableTariffs []string `json:"available_tariffs,omitempty"`

// Сurrent team subscription
Subscription Subscription `json:"subscription,omitempty"`
}

// Short team representation. For invites, push notifications, etc. Readonly.
Expand Down

0 comments on commit 783eff8

Please sign in to comment.