diff --git a/core/deleter/mocks/credit_service.go b/core/deleter/mocks/credit_service.go index bef1a735b7..e34cdb5799 100644 --- a/core/deleter/mocks/credit_service.go +++ b/core/deleter/mocks/credit_service.go @@ -68,6 +68,63 @@ func (_c *CreditService_DeleteByAccountID_Call) RunAndReturn(run func(context.Co return _c } +// GetBalance provides a mock function with given fields: ctx, accountID +func (_m *CreditService) GetBalance(ctx context.Context, accountID string) (int64, error) { + ret := _m.Called(ctx, accountID) + + if len(ret) == 0 { + panic("no return value specified for GetBalance") + } + + var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (int64, error)); ok { + return rf(ctx, accountID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) int64); ok { + r0 = rf(ctx, accountID) + } else { + r0 = ret.Get(0).(int64) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, accountID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CreditService_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' +type CreditService_GetBalance_Call struct { + *mock.Call +} + +// GetBalance is a helper method to define mock.On call +// - ctx context.Context +// - accountID string +func (_e *CreditService_Expecter) GetBalance(ctx interface{}, accountID interface{}) *CreditService_GetBalance_Call { + return &CreditService_GetBalance_Call{Call: _e.mock.On("GetBalance", ctx, accountID)} +} + +func (_c *CreditService_GetBalance_Call) Run(run func(ctx context.Context, accountID string)) *CreditService_GetBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *CreditService_GetBalance_Call) Return(_a0 int64, _a1 error) *CreditService_GetBalance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CreditService_GetBalance_Call) RunAndReturn(run func(context.Context, string) (int64, error)) *CreditService_GetBalance_Call { + _c.Call.Return(run) + return _c +} + // NewCreditService creates a new instance of CreditService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewCreditService(t interface { diff --git a/core/deleter/mocks/subscription_service.go b/core/deleter/mocks/subscription_service.go index 874edb3252..edbf1ec79b 100644 --- a/core/deleter/mocks/subscription_service.go +++ b/core/deleter/mocks/subscription_service.go @@ -7,6 +7,7 @@ import ( customer "github.com/raystack/frontier/billing/customer" + subscription "github.com/raystack/frontier/billing/subscription" mock "github.com/stretchr/testify/mock" ) @@ -70,6 +71,65 @@ func (_c *SubscriptionService_DeleteByCustomer_Call) RunAndReturn(run func(conte return _c } +// List provides a mock function with given fields: ctx, filter +func (_m *SubscriptionService) List(ctx context.Context, filter subscription.Filter) ([]subscription.Subscription, error) { + ret := _m.Called(ctx, filter) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 []subscription.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, subscription.Filter) ([]subscription.Subscription, error)); ok { + return rf(ctx, filter) + } + if rf, ok := ret.Get(0).(func(context.Context, subscription.Filter) []subscription.Subscription); ok { + r0 = rf(ctx, filter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]subscription.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, subscription.Filter) error); ok { + r1 = rf(ctx, filter) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SubscriptionService_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type SubscriptionService_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - filter subscription.Filter +func (_e *SubscriptionService_Expecter) List(ctx interface{}, filter interface{}) *SubscriptionService_List_Call { + return &SubscriptionService_List_Call{Call: _e.mock.On("List", ctx, filter)} +} + +func (_c *SubscriptionService_List_Call) Run(run func(ctx context.Context, filter subscription.Filter)) *SubscriptionService_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(subscription.Filter)) + }) + return _c +} + +func (_c *SubscriptionService_List_Call) Return(_a0 []subscription.Subscription, _a1 error) *SubscriptionService_List_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SubscriptionService_List_Call) RunAndReturn(run func(context.Context, subscription.Filter) ([]subscription.Subscription, error)) *SubscriptionService_List_Call { + _c.Call.Return(run) + return _c +} + // NewSubscriptionService creates a new instance of SubscriptionService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSubscriptionService(t interface {