Skip to content
Permalink
Browse files

add coupon price adjustment to `up team` output. Closes #516

  • Loading branch information...
tj committed Dec 27, 2017
1 parent 094fe13 commit c9844a3be5b2d73fab5b7ff6da757d307f5dd843
Showing with 7 additions and 1 deletion.
  1. +7 −1 internal/cli/team/team.go
@@ -189,11 +189,17 @@ func status(cmd *kingpin.Cmd) {
return errors.Wrap(err, "fetching cards")
}

// TODO: filter on plan type (later may be other products)
p := plans[0]
c := cards[0]

util.LogName("subscription", p.PlanName)
util.LogName("card", "%s ending with %s", c.Brand, c.LastFour)

if d := p.Discount; d != nil {
p.Amount = d.Coupon.Discount(p.Amount)
util.LogName("coupon", d.Coupon.ID)
}

util.LogName("amount", "$%0.2f/mo USD", float64(p.Amount)/100)
util.LogName("created", p.CreatedAt.Format("January 2, 2006"))
if p.Canceled {

0 comments on commit c9844a3

Please sign in to comment.
You can’t perform that action at this time.