2
0

referrral.go 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. package test
  2. import (
  3. "errors"
  4. "github.com/porter-dev/porter/internal/models"
  5. "github.com/porter-dev/porter/internal/repository"
  6. )
  7. // ReferralRepository represents the set of queries on the Referral model
  8. type ReferralRepository struct{}
  9. // NewAppInstanceRepository returns the test AppInstanceRepository
  10. func NewReferralRepository() repository.ReferralRepository {
  11. return &ReferralRepository{}
  12. }
  13. func (repo *ReferralRepository) CreateReferral(referral *models.Referral) (*models.Referral, error) {
  14. return referral, errors.New("cannot read database")
  15. }
  16. func (repo *ReferralRepository) CountReferralsByProjectID(projectID uint, status string) (int64, error) {
  17. return 0, errors.New("cannot read database")
  18. }
  19. func (repo *ReferralRepository) GetReferralByReferredID(referredID uint) (*models.Referral, error) {
  20. return &models.Referral{}, errors.New("cannot read database")
  21. }
  22. func (repo *ReferralRepository) UpdateReferral(referral *models.Referral) (*models.Referral, error) {
  23. return referral, errors.New("cannot read database")
  24. }