33 lines
906 B
Go
33 lines
906 B
Go
package mocks
|
|
|
|
import (
|
|
"time"
|
|
|
|
"fiskerinc.com/modules/common"
|
|
"fiskerinc.com/modules/db/queries"
|
|
"github.com/go-pg/pg/v10/orm"
|
|
)
|
|
|
|
type MockCarVersionsLog struct {
|
|
MockLogVersionChange func(log *common.CarVersionLogs) (orm.Result, error)
|
|
MockSelectByVIN func(vin string, options *queries.PageQueryOptions) ([]common.CarVersionLogs, int, error)
|
|
GetCarVersionsResult map[string]string
|
|
DBMockHelper
|
|
}
|
|
|
|
func (m MockCarVersionsLog) LogVersionChange(log *common.CarVersionLogs) (orm.Result, error) {
|
|
return m.MockLogVersionChange(log)
|
|
}
|
|
|
|
func (m MockCarVersionsLog) SelectByVIN(vin string, options *queries.PageQueryOptions) ([]common.CarVersionLogs, int, error) {
|
|
return m.MockSelectByVIN(vin, options)
|
|
}
|
|
|
|
func (m MockCarVersionsLog) GetCarVersions(vin string, timestamp time.Time) (map[string]string, error) {
|
|
if m.Error != nil {
|
|
return nil, m.Error
|
|
}
|
|
|
|
return m.GetCarVersionsResult, nil
|
|
}
|