ui/usage.go
func (h *Handler) GetOfferingUsage(password, offeringID string) (*uint, error) {
	logger := h.logger.Add("method", "GetOfferingUsage",
		"offeringID", offeringID)

	return h.uintFromQuery(logger, password,
		`SELECT SUM(sessions.units_used)
		   FROM channels
		   	JOIN sessions
			ON sessions.channel=channels.id
			   AND channels.offering=$1`,
		offeringID)
}
func (h *Handler) GetOfferingUsage(password, offeringID string) (*uint, error) {
	logger := h.logger.Add("method", "GetOfferingUsage",
		"offeringID", offeringID)

	return h.uintFromQuery(logger, password,
		`SELECT SUM(sessions.units_used)
		   FROM channels
		   	JOIN sessions
			ON sessions.channel=channels.id
			   AND channels.offering=$1`,
		offeringID)
}
// GetOfferingUsage returns total units used for all channels
// with a given offering.