package mocks

import (
	"github.com/fiskerinc/cloud-services/pkg/common"

	"github.com/go-pg/pg/v10/orm"
)

type MockSubscriptionTypes struct {
	ORMResult  orm.Result
	Error      error
	ListResult []common.SubscriptionType
}

func (st *MockSubscriptionTypes) Select(filter *common.SubscriptionType) ([]common.SubscriptionType, error) {
	return st.ListResult, st.Error
}

func (st *MockSubscriptionTypes) Insert(subtype *common.SubscriptionType) (orm.Result, error) {
	return st.ORMResult, st.Error
}

func (st *MockSubscriptionTypes) Update(subtype *common.SubscriptionType) (orm.Result, error) {
	return st.ORMResult, st.Error
}

func (st *MockSubscriptionTypes) Delete(subtype *common.SubscriptionType) (orm.Result, error) {
	return st.ORMResult, st.Error
}

func (st *MockSubscriptionTypes) Load(subtype *common.SubscriptionType) error {
	return st.Error
}

func (st *MockSubscriptionTypes) Count(filter *common.SubscriptionType) (int, error) {
	return len(st.ListResult), st.Error
}
