Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
package mocks
import (
"fiskerinc.com/modules/common"
"fiskerinc.com/modules/db/queries"
"github.com/go-pg/pg/v10/orm"
)
// CarUpdate query methods
type MockSupplierAccounts struct {
DBMockHelper
MockListResponse []common.SupplierAccount
MockSupplierAccount *common.SupplierAccount
}
func (c *MockSupplierAccounts) Count(account *common.SupplierAccount) (int, error) {
return len(c.MockListResponse), c.Error
}
func (c *MockSupplierAccounts) Delete(account *common.SupplierAccount) (orm.Result, error) {
c.LastFilter = account
return c.ORMResponse, c.Error
}
func (c *MockSupplierAccounts) Insert(account *common.SupplierAccount) (orm.Result, error) {
c.LastFilter = account
return c.ORMResponse, c.Error
}
func (c *MockSupplierAccounts) Load(account *common.SupplierAccount) error {
c.LastFilter = account
if c.MockSupplierAccount != nil {
account.ECUs = c.MockSupplierAccount.ECUs
account.ActivatedAt = c.MockSupplierAccount.ActivatedAt
}
return c.Error
}
func (c *MockSupplierAccounts) Select(account *common.SupplierAccount, paging *queries.PageQueryOptions) ([]common.SupplierAccount, error) {
c.LastFilter = account
c.LastPaging = paging
return c.MockListResponse, c.Error
}
func (c *MockSupplierAccounts) Update(account *common.SupplierAccount) (orm.Result, error) {
c.LastFilter = account
return c.ORMResponse, c.Error
}
func (c *MockSupplierAccounts) Approve(email string) (orm.Result, error) {
return c.ORMResponse, c.Error
}
func (c *MockSupplierAccounts) UpdateTimestamp(email string, activity queries.SupplierTimestamp) (orm.Result, error) {
return c.ORMResponse, c.Error
}
func (c *MockSupplierAccounts) SetListResp(list interface{}) {
if list != nil {
c.MockListResponse = list.([]common.SupplierAccount)
}
}
func (c *MockSupplierAccounts) SetLoadResp(item interface{}) {
// fmt.Printf("override SetLoadResp() in %s\n", reflect.TypeOf(item))
}