package mocks

import (
	"github.com/fiskerinc/cloud-services/pkg/common"
	"github.com/fiskerinc/cloud-services/pkg/db/queries"
	"github.com/go-pg/pg/v10/orm"
)

type MockEcuDtc struct {
	DBMockHelper
	SelectDTCECUResponse []common.DTC_ECU
	LastInsertCount int
}

func (c *MockEcuDtc) Insert(ecudtc *[]common.DTC_ECU) (orm.Result, error) {
	c.LastInsertCount = len(*ecudtc)
	return c.ORMResponse, c.Error
}

func (c *MockEcuDtc) UpdateTimestamp(dtc *common.DTC_ECU) error {
	return c.Error
}

func (c *MockEcuDtc) Select(ecudtc common.DTC_ECUQuery, paging *queries.PageQueryOptions) ([]common.DTC_ECU, error) {
	return c.SelectDTCECUResponse, c.Error
}

func (c *MockEcuDtc) Count(filter common.DTC_ECUQuery) (int, error) {
	return 0, c.Error
}
