human:john.doe1package pricing
human:john.doe2
human:john.doe3// Plan is one billable customer plan.
human:john.doe4type Plan struct {
human:john.doe5 Name string
human:john.doe6 Seats int
human:john.doe7}
human:john.doe8
human:john.doe9func (p Plan) Valid() bool {
human:john.doe10 return p.Name != "" && p.Seats > 0
human:john.doe11}
ai:droid/claude-sonnet-4-512
ai:droid/claude-sonnet-4-513// Total returns the plan price for one billing period.
ai:droid/claude-sonnet-4-514func (p Plan) Total(unit int) int {
human-override:john.doe/droid/claude-sonnet-4-515 // Volume discount applies from the eleventh seat.
human-override:john.doe/droid/claude-sonnet-4-516 if p.Seats > 10 {
human-override:john.doe/droid/claude-sonnet-4-517 return unit * p.Seats * 9 / 10
human-override:john.doe/droid/claude-sonnet-4-518 }
human-override:john.doe/droid/claude-sonnet-4-519 return unit * p.Seats
ai:droid/claude-sonnet-4-520}
ai:droid/claude-sonnet-4-521
ai:droid/claude-sonnet-4-522// Annual returns the discounted price for a yearly commitment.
ai:droid/claude-sonnet-4-523func (p Plan) Annual(unit int) int {
ai:droid/claude-sonnet-4-524 return p.Total(unit) * 10
ai:droid/claude-sonnet-4-525}