/
service_mock.go
35 lines (28 loc) · 1.35 KB
/
service_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package mock
import (
"context"
hubspotDomain "gitlab.slade360emr.com/go/commontools/crm/pkg/domain"
)
// FakeServiceCrm ..
type FakeServiceCrm struct {
OptOutFn func(ctx context.Context, phoneNumber string) (*hubspotDomain.CRMContact, error)
CreateHubSpotContactFn func(ctx context.Context, contact *hubspotDomain.CRMContact) (*hubspotDomain.CRMContact, error)
UpdateHubSpotContactFn func(ctx context.Context, contact *hubspotDomain.CRMContact) (*hubspotDomain.CRMContact, error)
GetContactByPhoneFn func(ctx context.Context, phone string) (*hubspotDomain.CRMContact, error)
}
// OptOut ..
func (f *FakeServiceCrm) OptOut(ctx context.Context, phoneNumber string) (*hubspotDomain.CRMContact, error) {
return f.OptOutFn(ctx, phoneNumber)
}
// CreateHubSpotContact ..
func (f *FakeServiceCrm) CreateHubSpotContact(ctx context.Context, contact *hubspotDomain.CRMContact) (*hubspotDomain.CRMContact, error) {
return f.CreateHubSpotContactFn(ctx, contact)
}
// UpdateHubSpotContact ..
func (f *FakeServiceCrm) UpdateHubSpotContact(ctx context.Context, contact *hubspotDomain.CRMContact) (*hubspotDomain.CRMContact, error) {
return f.UpdateHubSpotContactFn(ctx, contact)
}
// GetContactByPhone ..
func (f *FakeServiceCrm) GetContactByPhone(ctx context.Context, phone string) (*hubspotDomain.CRMContact, error) {
return f.GetContactByPhoneFn(ctx, phone)
}