proc/worker/client.go
func (w *Worker) DecrementCurrentSupply(job *data.Job) error {
	logger := w.logger.Add("method", "DecrementCurrentSupply", "job", job)
	offering, err := w.relatedOffering(logger, job, data.JobDecrementCurrentSupply)
	if err != nil {
		return err
	}

	offering.CurrentSupply--

	err = data.Save(w.db.Querier, offering)
	if err != nil {
		logger.Error(err.Error())
		return ErrInternal
	}

	return nil
}
func (w *Worker) DecrementCurrentSupply(job *data.Job) error {
	logger := w.logger.Add("method", "DecrementCurrentSupply", "job", job)
	offering, err := w.relatedOffering(logger, job, data.JobDecrementCurrentSupply)
	if err != nil {
		return err
	}

	offering.CurrentSupply--

	err = data.Save(w.db.Querier, offering)
	if err != nil {
		logger.Error(err.Error())
		return ErrInternal
	}

	return nil
}
func ( w * Worker ) DecrementCurrentSupply ( job * data . Job ) error { logger := w . logger . Add ( " " , " " , " " , job ) offering , err := w . relatedOffering ( logger , job , data . JobDecrementCurrentSupply ) if err != nil { return err } offering . CurrentSupply -- err = data . Save ( w . db . Querier , offering ) if err != nil { logger . Error ( err . Error ( ) ) return ErrInternal } return nil }
// DecrementCurrentSupply finds offering and decrements its current supply.
DecrementCurrentSupply finds offering and decrements its current supply .