Sprint

In the 'sprint.go' file, change the struct and constructor to:

type sprintService struct {
	txProvider     database.TxProvider
	repo           repositories.SprintRepo
	cerberusClient cerberus.CerberusClient
}

func NewSprintService(
	txProvider database.TxProvider,
	repo repositories.SprintRepo,
	cerberusClient cerberus.CerberusClient) SprintService {
	return &sprintService{
		txProvider:     txProvider,
		repo:           repo,
		cerberusClient: cerberusClient,
	}
}

And the 'Create' function:

.
.
.
err = s.cerberusClient.ExecuteWithCtx(ctx, s.cerberusClient.CreateResourceCmd(sprint.Id, projectId, common.Sprint_RT))
if err != nil {
	if rbe := tx.Rollback(); rbe != nil {
		err = fmt.Errorf("rollback error (%v) after %w", rbe, err)
	}
	return repositories.Sprint{}, err
}

return sprint, tx.Commit()

Last updated