interfaces

package
v0.0.0-...-c85e528 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIService

type AIService interface {
	AskAI(ctx context.Context, model enum.AIModel, prompt *string) (*string, error)
}

type ActionService

type ActionService interface {
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	GetActionsForNodes(ctx context.Context, entityType model.EntityType, ids []string) (*entity.ActionEntities, error)
	CreateActionForOrganization(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, organizationId string, actionFields data_fields.ActionFields) (string, error)
}

type AgentCapabilities

type AgentCapabilities struct {
	Capabilities []Capability `json:"capabilities"`
}

type AgentService

type AgentService interface {
	CreateAgent(ctx context.Context) (*entity.Agents, error)
	RunAgent(ctx context.Context, agent *entity.Agents, eventData any) error
	AgentCapabilities(ctx context.Context, agent *entity.Agents) (*AgentCapabilities, error)

	SetActionService(action ActionService)
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool
}

type AttachmentService

type AttachmentService interface {
	GetById(ctx context.Context, id string) (*entity.AttachmentEntity, error)
	GetFor(ctx context.Context, entityType model.EntityType, relation *model.EntityRelation, ids []string) (*entity.AttachmentEntities, error)
	Create(ctx context.Context, record *entity.AttachmentEntity) (*entity.AttachmentEntity, error)
}

type AzureService

type AzureService interface {
	ReadEmailsFromAzureAd(ctx context.Context, importState *entity.UserEmailImportState) ([]*entity.EmailRawData, string, error)
	SendEmail(ctx context.Context, request *entity.EmailMessage) error
}

type Capability

type Capability struct {
	Name     string `json:"name"`
	Action   string `json:"action"`
	Optional bool   `json:"optional,omitempty"`
}

type CloudflareService

type CloudflareService interface {
	SetupDomainForMailStack(ctx context.Context, tenant, domain, destinationUrl string) ([]string, error)
	AddDNSRecord(ctx context.Context, zoneID, recordType, name, content string, ttl int, proxied bool, priority *int) error
	GetDNSRecords(ctx context.Context, domain string) (*[]DNSRecord, error)
	DeleteDNSRecord(ctx context.Context, zoneID string, recordID string) error
	CheckDomainExists(ctx context.Context, domain string) (bool, string, error)
}

type CommentService

type CommentService interface {
	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, commentFields data_fields.CommentFields) (string, error)
}

type CompanyDetails

type CompanyDetails struct {
	Name          string          `json:"name"`
	Domain        string          `json:"domain"`
	Website       string          `json:"website"`
	Industry      string          `json:"industry"`
	FoundedYear   interface{}     `json:"founded_year"`
	EmployeeRange string          `json:"employee_range"`
	AnnualRevenue interface{}     `json:"annual_revenue"`
	TotalFunding  interface{}     `json:"total_funding"`
	Location      Location        `json:"location"`
	Description   string          `json:"description"`
	Phone         string          `json:"phone"`
	Geo           GeoLocation     `json:"geo"`
	Profiles      *SocialProfiles `json:"profiles"`
}

CompanyDetails contains the main company information

type ContactService

type ContactService interface {
	SetEmailService(email EmailService)
	SetOrganizationService(org OrganizationService)
	SetJobRoleService(jobrole JobRoleService)
	SetSocialService(social SocialService)
	SetFlowService(flow FlowService)
	IsInitialized() bool

	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, contactFields data_fields.ContactFields, updateOnlyIfEmpty bool, options ...common_srv.ServiceOptions) (string, error)
	CreateContactByLinkedIn(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, linkedInUrl string, options ...common_srv.ServiceOptions) (string, error)
	CreateContactWithOrganizationByEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, email string) (string, error)
	CreateContactByEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, email string, options ...common_srv.ServiceOptions) (string, error)
	HideContact(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, contactId string) error
	ShowContact(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, contactId string) error
	LinkContactWithOrganization(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, contactId, organizationId, jobTitle, description, source string, primary bool, startedAt, endedAt *time.Time) error
	CheckContactExistsWithLinkedIn(ctx context.Context, url, alias, externalId string) (bool, string, error)
	CheckContactExistsWithEmail(ctx context.Context, email string) (bool, string, error)
	GetContactById(ctx context.Context, contactId string) (*entity.ContactEntity, error)
	GetContactsByIds(ctx context.Context, contactIds []string) ([]*entity.ContactEntity, error)
	SetPrimaryJobRole(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, contactId string, primaryOrganizationId *string) error
	GetFirstContactByEmail(ctx context.Context, email string) (*entity.ContactEntity, error)
}

type ContractService

type ContractService interface {
	SetOpportunityService(opportunity OpportunityService)
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	GetById(ctx context.Context, contactId string) (*entity.ContractEntity, error)
	Save(ctx context.Context, contactId *string, dataFields data_fields.ContractSaveFields) (string, error)
	SoftDelete(ctx context.Context, contractId string) error
	RefreshContractStatus(ctx context.Context, contractId string) error
	RecalculateContractLtv(ctx context.Context, contractId string) error
	UpdateActiveRenewalOpportunityArr(ctx context.Context, contractId string) error
	UpdateActiveRenewalOpportunityRenewDateAndArr(ctx context.Context, tenant, contractId string) error
	UpdateActiveRenewalOpportunityLikelihood(ctx context.Context, tenant, contractId string) error
}

type CreateMailboxRequest

type CreateMailboxRequest struct {
	Domain          string
	Username        string
	Password        string
	LinkedUserEmail string
	WebmailEnabled  bool
	ForwardingTo    []string

	IgnoreDomainOwnership bool
}

type CurrencyService

type CurrencyService interface {
	GetRate(ctx context.Context, fromCurrency, toCurrency string) (float64, error)
}

type CustomFieldTemplateService

type CustomFieldTemplateService interface {
	GetAll(ctx context.Context) (*entity.CustomFieldTemplateEntities, error)
	GetById(ctx context.Context, customFieldTemplateId string) (*entity.CustomFieldTemplateEntity, error)
	Save(ctx context.Context, id *string, input repository.CustomFieldTemplateSaveFields) (string, error)
	Delete(ctx context.Context, customFieldTemplateId string) error
}

type DNSRecord

type DNSRecord struct {
	ID      string `json:"id"`
	ZoneID  string `json:"zone_id"`
	Name    string `json:"zone_name"`
	Type    string `json:"type"`
	Content string `json:"content"`
}

type DomainService

type DomainService interface {
	GetPrimaryDomainForOrganizationWebsite(ctx context.Context, websiteUrl string) (string, string)
	IsKnownCompanyHostingUrl(ctx context.Context, website string) bool
	GetAllDomainsForOrganizations(ctx context.Context, organizationIds []string) (*entity.DomainEntities, error)
	UpdateDomainPrimaryDetails(ctx context.Context, domain string) error
	MergeDomain(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, domain string) error
	GetDomain(ctx context.Context, domain string) (*entity.DomainEntity, error)
	IsAcceptedDomainForOrganization(ctx context.Context, domain string) bool
	CheckDomainWithMailsherpa(ctx context.Context, domain string) (bool, bool, string)
}

type EmailContent

type EmailContent struct {
	Html     string
	Text     string
	Subject  string
	SentDate string
}

Core message content

type EmailFields

type EmailFields struct {
	Email     string            `json:"email"`
	Source    entity.DataSource `json:"source"`
	AppSource string            `json:"appSource"`
	Primary   bool              `json:"primary"`
}

type EmailHeaders

type EmailHeaders struct {
	AutoSubmitted      bool
	ContentDescription string
	DeliveryStatus     bool
	ListUnsubscribe    bool
	Precedence         string
	ReturnPath         string
	ReturnPathExists   bool
	XAutoreply         string
	XAutoresponse      string
	XLoop              bool
	XFailedRecepients  []string
	ReplyTo            string
	ReplyToExists      bool
	Sender             string
	ForwardedFor       string
	RawHeaders         map[string]string
}

Headers

type EmailIdentifiers

type EmailIdentifiers struct {
	EmailThreadId       string
	ExternalSystem      string
	ContactsExternalIds []string
	UserExternalId      string
	ProviderMessageId   string
	MessageId           string
	References          []string
}

identifiers

type EmailMessageData

type EmailMessageData struct {
	Content      EmailContent
	Headers      EmailHeaders
	Participants EmailParticipants
	Identifiers  EmailIdentifiers
	CreatedAt    time.Time
	Channel      string
	ChannelData  *string
}

Combined message data

type EmailParticipant

type EmailParticipant struct {
	Email     string
	FirstName string
	LastName  string
}

type EmailParticipants

type EmailParticipants struct {
	From      EmailParticipant
	To        []EmailParticipant
	Cc        []EmailParticipant
	Bcc       []EmailParticipant
	ReplyTo   []EmailParticipant
	AllEmails []string
}

Message routing/delivery information

func (EmailParticipants) GetBccEmailAddresses

func (ep EmailParticipants) GetBccEmailAddresses() []string

func (EmailParticipants) GetCcEmailAddresses

func (ep EmailParticipants) GetCcEmailAddresses() []string

func (EmailParticipants) GetReplyToEmailAddresses

func (ep EmailParticipants) GetReplyToEmailAddresses() []string

func (EmailParticipants) GetToEmailAddresses

func (ep EmailParticipants) GetToEmailAddresses() []string

type EmailRawData

type EmailRawData struct {
	ProviderMessageId string            `json:"ProviderMessageId"`
	MessageId         string            `json:"MessageId"`
	Sent              string            `json:"Sent"`
	Subject           string            `json:"Subject"`
	From              string            `json:"From"`
	To                string            `json:"To"`
	Cc                string            `json:"Cc"`
	Bcc               string            `json:"Bcc"`
	Html              string            `json:"Html"`
	Text              string            `json:"Text"`
	ThreadId          string            `json:"ThreadId"`
	InReplyTo         string            `json:"InReplyTo"`
	Reference         string            `json:"Reference"`
	Headers           map[string]string `json:"Headers"`
}

Email Raw Data

type EmailService

type EmailService interface {
	SetContactService(contact ContactService)
	SetOrganizationService(org OrganizationService)
	SetDomainService(domainService DomainService)
	IsInitialized() bool

	Merge(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, tenant string, emailFields EmailFields, linkWith *common_srv.LinkWith) (*string, error)
	ReplaceEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, previousEmail string, emailFields EmailFields, linkWith common_srv.LinkWith) (*string, error)
	UnlinkEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, email, appSource string, linkWith common_srv.LinkWith) error
	DeleteOrphanEmail(ctx context.Context, emailId string) error
	GetAllEmailsForEntityIds(ctx context.Context, tenant string, entityType model.EntityType, entityIds []string) (*entity.EmailEntities, error)
	SetPrimary(ctx context.Context, email string, forEntity common_srv.LinkWith) error
	GetPrimaryEmailForEntityId(ctx context.Context, entityType model.EntityType, entityId string) (*entity.EmailEntity, error)
	GetPrimaryEmailsForEntityIds(ctx context.Context, entityType model.EntityType, entityIds []string) (*entity.EmailEntities, error)
	UpdateEmailValidationDetails(ctx context.Context, emailId string, validationFields data_fields.EmailValidationFields) error
	RequestEmailValidation(ctx context.Context, emailId string) error
}

type EmailingService

type EmailingService interface {
	GenerateEmailSpyPixelUrl(ctx context.Context, tenant, publicUrl, uniqueMessageId, campaign, recipientId string, trackOpens bool) (url string, mid string, err error)
	GenerateEmailLinkUrl(ctx context.Context, tenant, publicUrl, redirectUrl, uniqueMessageId, campaign, recipientId string, trackClicks bool) (url string, mid string, lid string, err error)
	GenerateEmailUnsubscribeUrl(ctx context.Context, tenant, publicUrl, unsubscribeUrl, uniqueMessageId, campaign, recipientId string) (url string, mid string, err error)
}

type EnrichmentService

type EnrichmentService interface {
	//primary interfaces
	EnrichOrganization(ctx context.Context, domain, linkedinURL *string) (*OrganizationData, error)
	EnrichPerson(ctx context.Context, person PersonSearch) (*uint64, *entity.ScrapInResponseBody, error)
	IPIdentity(ctx context.Context, ipAddress string) (*SnitcherResponse, error)
	FindWorkEmail(ctx context.Context, linkedInUrl, firstName, lastName, companyName, companyDomain string, enrichPhoneNumber bool) (dbID string, betterContactRequstID string, response *entity.BetterContactResponseBody, err error)

	// only use if you must
	GetBrandfetchByDomain(ctx context.Context, domain string) (*entity.BrandfetchResponseBody, error)

	ScrapInPersonProfile(ctx context.Context, linkedInUrl string) (uint64, *entity.ScrapInResponseBody, error)
	ScrapInSearchPerson(ctx context.Context, email, fistName, lastName, domain, companyName string) (uint64, *entity.ScrapInResponseBody, error)
	ScrapInCompanyProfile(ctx context.Context, linkedInUrl string) (uint64, *entity.ScrapInResponseBody, error)
	ScrapInSearchCompany(ctx context.Context, domain string) (uint64, *entity.ScrapInResponseBody, error)
}

type EventHandler

type EventHandler struct {
	HandlerFunc func(ctx context.Context, event any) error
	EventType   string
	DataType    reflect.Type
}

type EventPublisher

type EventPublisher interface {
	PublishEvent(ctx context.Context, entityId string, entityType model.EntityType, message interface{}) error
	PublishEventOnExchange(ctx context.Context, entityId string, entityType model.EntityType, message interface{}, exchange, routingKey string) error
	PublishEventCompleted(ctx context.Context, tenant string, entityId string, entityType model.EntityType, details *utils.EventCompletedDetails)
	PublishEventCompletedBulk(ctx context.Context, tenant string, entityIds []string, entityType model.EntityType, details *utils.EventCompletedDetails)
	PublishWebhookEvent(ctx context.Context, event dto.WebhookEvent) error
	PublishFlowAgentEvent(ctx context.Context, event dto.FlowAgentEvent) error
	PublishFlowAgentEventResult(ctx context.Context, event dto.FlowAgentExecutionResultEvent) error
	Close() error
}

type EventSubscriber

type EventSubscriber interface {
	RegisterHandler(eventType interface{}, handler EventHandler)
	ListenQueue(queueName string) error
	ListenQueueExclusive(queueName string) error
	Close() error
}

type ExternalSystemService

type ExternalSystemService interface {
	MergeExternalSystem(ctx context.Context, tenant, externalSystem string) error
	SetPrimaryExternalId(ctx context.Context, externalSystem, externalId string, linkWith common_srv.LinkWith) error
	GetPrimaryExternalId(ctx context.Context, externalSystem, linkedWithId string, linkedWithEntityType model.EntityType) (string, error)
	GetExternalSystemsForEntities(ctx context.Context, ids []string, entityType model.EntityType) (*entity.ExternalSystemEntities, error)
}

type File

type File struct {
	ID        string
	FileName  string
	MimeType  string
	BasePath  string
	Size      int64
	CdnUrl    string
	PublicUrl string
}

type FileDTO

type FileDTO struct {
	Id          string `json:"id"`
	FileName    string `json:"fileName"`
	MimeType    string `json:"mimeType"`
	Size        int64  `json:"size"`
	MetadataUrl string `json:"previewUrl"`
	DownloadUrl string `json:"downloadUrl"`
	CdnUrl      string `json:"cdnUrl"`
}

type FileService

type FileService interface {
	GetById(ctx context.Context, id string) (*File, error)
	UploadSingleFile(ctx context.Context, basePath, fileId string, multipartFileHeader *multipart.FileHeader, cdnUpload bool) (*File, error)
	DownloadSingleFile(ctx context.Context, id string, context *gin.Context, inline bool) (*File, error)
	Base64Image(ctx context.Context, id string) (*string, error)
	GetFilePublicUrl(ctx context.Context, id string) (string, error)
	GetFileBytes(ctx context.Context, fileURL string) (*[]byte, error)
	UploadSingleFileBytes(ctx context.Context, basePath, fileID, fileName string, content *[]byte, cdn bool) (*File, error)
}

type FlowComputeParticipantsRequirementsInput

type FlowComputeParticipantsRequirementsInput struct {
	PrimaryEmailRequired      bool `json:"primaryEmailRequired"`
	LinkedInSocialUrlRequired bool `json:"linkedInSocialUrlRequired"`
}

type FlowExecutionService

type FlowExecutionService interface {
	SetEmailService(email EmailService)
	SetFlowService(flow FlowService)
	SetOrganizationService(org OrganizationService)
	SetSocialService(social SocialService)
	IsInitialized() bool

	GetFlowActionExecutionById(ctx context.Context, flowActionExecution string) (*entity.FlowActionExecutionEntity, error)
	GetFlowExecutionSettingsForEntity(ctx context.Context, tx *neo4j.ManagedTransaction, flowId, entityId string, entityType model.EntityType) (*entity.FlowExecutionSettingsEntity, error)
	GetFlowRequirements(ctx context.Context, flowId string) (*FlowComputeParticipantsRequirementsInput, error)
	GetFlowActionExecutionsForParticipants(ctx context.Context, flowParticipantIds []string) (*entity.FlowActionExecutionEntities, error)
	GetFlowActionExecutionsForParticipant(ctx context.Context, tx *neo4j.ManagedTransaction, flowId, entityId string, entityType model.EntityType) ([]*entity.FlowActionExecutionEntity, error)
	GetFlowActionExecutionsForParticipantWithActionType(ctx context.Context, entityId string, entityType model.EntityType, actionType entity.FlowActionType) ([]*entity.FlowActionExecutionEntity, error)
	UpdateAllParticipantsFlowRequirements(ctx context.Context, flowId string) error
	UpdateParticipantFlowRequirements(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, participant *entity.FlowParticipantEntity, requirements *FlowComputeParticipantsRequirementsInput) error
	ScheduleFlow(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, flowId string, flowParticipant *entity.FlowParticipantEntity) error
	ProcessActionExecution(ctx context.Context, scheduledActionExecution *entity.FlowActionExecutionEntity) error
	ReplacePlaceholder(input, variableName, value string) string
}

type FlowNextStep

type FlowNextStep struct {
	FlowID      string
	FromNodeID  string
	ToNodeID    string
	ToNodeType  enum.FlowNodeType
	ToNodeAgent enum.FlowAgent
}

type FlowService

type FlowService interface {
	SetFlowExecutionService(fe FlowExecutionService)
	IsInitialized() bool

	FlowGetList(ctx context.Context) (*neo4jentity.FlowEntities, error)
	FlowGetById(ctx context.Context, id string) (*neo4jentity.FlowEntity, error)
	FlowGetByActionId(ctx context.Context, flowActionId string) (*neo4jentity.FlowEntity, error)
	FlowGetByParticipantId(ctx context.Context, tx *neo4j.ManagedTransaction, flowParticipantId string) (*neo4jentity.FlowEntity, error)
	FlowsGetListWithParticipant(ctx context.Context, entityIds []string, entityType model.EntityType) (*neo4jentity.FlowEntities, error)
	FlowsGetListWithSender(ctx context.Context, senderIds []string) (*neo4jentity.FlowEntities, error)
	FlowMerge(ctx context.Context, tx *neo4j.ManagedTransaction, entity *neo4jentity.FlowEntity) (*neo4jentity.FlowEntity, error)
	FlowOn(ctx context.Context, id string) (*neo4jentity.FlowEntity, error)
	FlowOff(ctx context.Context, id string) (*neo4jentity.FlowEntity, error)
	FlowArchive(ctx context.Context, id string) (*neo4jentity.FlowEntity, error)

	FlowActionGetStart(ctx context.Context, flowId string) (*neo4jentity.FlowActionEntity, error)
	FlowActionGetNext(ctx context.Context, actionId string) ([]*neo4jentity.FlowActionEntity, error)
	FlowActionGetList(ctx context.Context, flowIds []string) (*neo4jentity.FlowActionEntities, error)
	FlowActionGetById(ctx context.Context, id string) (*neo4jentity.FlowActionEntity, error)

	FlowParticipantGetList(ctx context.Context, flowIds []string) (*neo4jentity.FlowParticipantEntities, error)
	FlowParticipantById(ctx context.Context, flowParticipantId string) (*neo4jentity.FlowParticipantEntity, error)
	FlowParticipantByEntity(ctx context.Context, flowId, entityId string, entityType model.EntityType) (*neo4jentity.FlowParticipantEntity, error)
	FlowParticipantAdd(ctx context.Context, flowId, entityId string, entityType model.EntityType) (*neo4jentity.FlowParticipantEntity, error)
	FlowParticipantDelete(ctx context.Context, flowParticipantId string) error

	FlowSenderGetList(ctx context.Context, flowIds []string) (*neo4jentity.FlowSenderEntities, error)
	FlowSenderGetById(ctx context.Context, id string) (*neo4jentity.FlowSenderEntity, error)
	FlowSenderMerge(ctx context.Context, flowId string, input *neo4jentity.FlowSenderEntity) (*neo4jentity.FlowSenderEntity, error)
	FlowSenderDelete(ctx context.Context, flowSenderId string) error
}

type GeoLocation

type GeoLocation struct {
	Country      string  `json:"country"`
	CountryCode  string  `json:"country_code"`
	State        string  `json:"state"`
	StateCode    *string `json:"state_code"`
	PostalCode   *string `json:"postal_code"`
	City         string  `json:"city"`
	Street       *string `json:"street"`
	StreetNumber *string `json:"street_number"`
}

GeoLocation represents geographical information

type GoogleService

type GoogleService interface {
	ServiceAccountCredentialsExistsForTenant(ctx context.Context, tenant string) (bool, error)

	GetGmailService(ctx context.Context, username, tenant string) (*gmail.Service, error)

	GetGmailServiceWithServiceAccount(ctx context.Context, username string, tenant string) (*gmail.Service, error)
	GetGCalServiceWithServiceAccount(ctx context.Context, username string, tenant string) (*calendar.Service, error)

	GetGmailServiceWithOauthToken(ctx context.Context, tokenEntity entity.OAuthTokenEntity) (*gmail.Service, error)
	GetGCalServiceWithOauthToken(ctx context.Context, tokenEntity entity.OAuthTokenEntity) (*calendar.Service, error)

	ReadEmails(ctx context.Context, batchSize int64, importState *entity.UserEmailImportState) ([]*entity.EmailRawData, string, error)

	SendEmail(ctx context.Context, request *entity.EmailMessage) error
}

type HeaderAnalysis

type HeaderAnalysis struct {
	ProcessEmail    bool
	IsBounce        bool
	IsAutoResponder bool
	IsBulkMail      bool
	SkipReason      string
	BouncedEmails   []string
}

type IndustryService

type IndustryService interface {
	GetAllForOrganizationIds(ctx context.Context, organizationIds []string) (*entity.IndustryEntities, error)
	GetInUseIndustries(ctx context.Context) (*entity.IndustryEntities, error)
	GetByCode(ctx context.Context, code string) (*entity.IndustryEntity, error)
	GetClosestByCode(ctx context.Context, code string) (*entity.IndustryEntity, error)
}

type InteractionEventCreateData

type InteractionEventCreateData struct {
	InteractionEventEntity *neo4jentity.InteractionEventEntity
	SessionIdentifier      *string
	MeetingIdentifier      *string
	RepliesTo              *string
	SentBy                 []InteractionEventParticipantData
	SentTo                 []InteractionEventParticipantData
	SentCc                 []InteractionEventParticipantData
	SentBcc                []InteractionEventParticipantData
	ExternalSystem         *neo4jentity.ExternalSystemEntity
	Source                 neo4jentity.DataSource
	SourceOfTruth          neo4jentity.DataSource
}

type InteractionEventParticipantData

type InteractionEventParticipantData struct {
	Email       *string
	PhoneNumber *string
	ContactId   *string
	UserId      *string
}

type InteractionEventService

type InteractionEventService interface {
	SetEmailService(EmailService)
	IsInitialized() bool

	GetById(ctx context.Context, id string) (*neo4jentity.InteractionEventEntity, error)
	GetInteractionEventsForInteractionSessions(ctx context.Context, ids []string, loadContent bool) (*neo4jentity.InteractionEventEntities, error)
	GetInteractionEventsForMeetings(ctx context.Context, ids []string, loadContent bool) (*neo4jentity.InteractionEventEntities, error)
	GetInteractionEventsForIssues(ctx context.Context, issueIds []string, loadContent bool) (*neo4jentity.InteractionEventEntities, error)
	GetSentByParticipantsForInteractionEvents(ctx context.Context, ids []string) (*neo4jentity.InteractionEventParticipants, error)
	GetSentToParticipantsForInteractionEvents(ctx context.Context, ids []string) (*neo4jentity.InteractionEventParticipants, error)
	GetReplyToInteractionsEventForInteractionEvents(ctx context.Context, ids []string, loadContent bool) (*neo4jentity.InteractionEventEntities, error)

	Create(ctx context.Context, data *InteractionEventCreateData) (*string, error)
	CreateInTx(ctx context.Context, tx neo4j.ManagedTransaction, data *InteractionEventCreateData) (*string, error)
}

type InteractionSessionService

type InteractionSessionService interface {
	GetById(ctx context.Context, id string) (*entity.InteractionSessionEntity, error)
	GetAttendedByParticipantsForInteractionSessions(ctx context.Context, ids []string) (*entity.InteractionSessionParticipants, error)
	GetInteractionSessionsForInteractionEvents(ctx context.Context, ids []string) (*entity.InteractionSessionEntities, error)

	Create(ctx context.Context, data *entity.InteractionSessionEntity) (*string, error)
	CreateInTx(ctx context.Context, tx neo4j.ManagedTransaction, data *entity.InteractionSessionEntity) (*string, error)
}

type InvoiceService

type InvoiceService interface {
	SetContractService(contract ContractService)
	SetServiceLineItemService(sli ServiceLineItemService)
	IsInitialized() bool

	GenerateNewRandomInvoiceNumber() string

	GetById(ctx context.Context, invoiceId string) (*neo4jentity.InvoiceEntity, error)
	GetByIdAcrossAllTenants(ctx context.Context, invoiceId string) (*neo4jentity.InvoiceEntity, string, error)
	GetByNumber(ctx context.Context, number string) (*neo4jentity.InvoiceEntity, error)
	GetInvoiceLinesForInvoices(ctx context.Context, invoiceIds []string) (*neo4jentity.InvoiceLineEntities, error)
	GetInvoicesForContracts(ctx context.Context, contractIds []string) (*neo4jentity.InvoiceEntities, error)
	GetNonDryRunInvoicesForOrganization(ctx context.Context, tenant, organizationId string) (*neo4jentity.InvoiceEntities, error)
	SimulateInvoice(ctx context.Context, invoiceData *SimulateInvoiceRequestData) ([]*SimulateInvoiceResponseData, error)
	NextInvoiceDryRun(ctx context.Context, contractId, appSource string) (string, error)
	PayInvoice(ctx context.Context, invoiceId string) error
	VoidInvoice(ctx context.Context, invoiceId, appSource string) error
	UpdateInvoice(ctx context.Context, invoiceId string, data neo4jrepository.InvoiceUpdateFields) error

	FillCycleInvoice(ctx context.Context, invoiceEntity *neo4jentity.InvoiceEntity, sliEntities neo4jentity.ServiceLineItemEntities) (*neo4jentity.InvoiceEntity, []*invoicepb.InvoiceLine, error)
	// Deprecated: Method should be re-worked. DO NOT ENABLE IN PROD
	FillOffCyclePrepaidInvoice(ctx context.Context, invoiceEntity *neo4jentity.InvoiceEntity, sliEntities neo4jentity.ServiceLineItemEntities) (*neo4jentity.InvoiceEntity, []*invoicepb.InvoiceLine, error)
}

type IpThreats

type IpThreats struct {
	IsThreat      bool
	IsAnonymous   bool
	IsBogon       bool
	IsDatacenter  bool
	IsICloudRelay bool
	IsKnownAbuser bool
	IsProxy       bool
	IsTor         bool
	IsVpn         bool
}

type IssueService

type IssueService interface {
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, issueFields data_fields.IssueFields) (string, error)
	AddUserAssignee(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, issueId, userId string) error
	RemoveUserAssignee(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, issueId, userId string) error
	AddUserFollower(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, issueId, userId string) error
	RemoveUserFollower(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, issueId, userId string) error
}

type JobRoleService

type JobRoleService interface {
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, jobRoleId, contactId, organizationId *string, dataFields data_fields.JobRoleFields) (string, error)
	GetAllForContact(ctx context.Context, contactId string) (*entity.JobRoleEntities, error)
	GetAllForContacts(ctx context.Context, contactIds []string) (*entity.JobRoleEntities, error)
	GetAllForOrganization(ctx context.Context, organizationId string) (*entity.JobRoleEntities, error)
	GetAllForOrganizations(ctx context.Context, organizationIds []string) (*entity.JobRoleEntities, error)
	DeleteJobRole(ctx context.Context, contactId, roleId string) (bool, error)
	GetAllForUsers(ctx context.Context, userIds []string) (*entity.JobRoleEntities, error)
	GetJobRolesByIds(ctx context.Context, ids []string) (*entity.JobRoleEntities, error)
	IdentifyJobRole(ctx context.Context, contactId, organizationId string) (*entity.JobRoleEntity, error)
	GetById(ctx context.Context, jobRoleId string) (*entity.JobRoleEntity, error)
}

type Location

type Location struct {
	CityName     string `json:"cityName"`
	RegionName   string `json:"regionName"`
	PostalCode   string `json:"postalCode"`
	StreetName   string `json:"streetName"`
	StreetNumber string `json:"streetNumber"`
	Country      struct {
		Name string `json:"name"`
		Iso2 string `json:"iso2"`
		Iso3 string `json:"iso3"`
	} `json:"country"`
	RawLocation string // To store the raw string value if the location is a single string
}

func (*Location) UnmarshalJSON

func (l *Location) UnmarshalJSON(data []byte) error

Implement the UnmarshalJSON method for Location

type LocationService

type LocationService interface {
	SetContactService(contact ContactService)
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	GetAllForContact(ctx context.Context, contactId string) (*neo4jentity.LocationEntities, error)
	GetAllForContacts(ctx context.Context, contactIds []string) (*neo4jentity.LocationEntities, error)
	GetAllForOrganization(ctx context.Context, organizationId string) (*neo4jentity.LocationEntities, error)
	GetAllForOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.LocationEntities, error)
	ExtractAndEnrichLocation(ctx context.Context, tenant, address string) (*data_fields.LocationFields, error)
	Create(ctx context.Context, commit *utils.TxWithPostCommit, locationFields data_fields.LocationFields, linkWith *common_srv.LinkWith) (string, error)
}

type LogEntryService

type LogEntryService interface {
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	Save(ctx context.Context, id *string, logEntryFields data_fields.LogEntryFields) (string, error)
}

type MailService

type MailService interface {
	SetContactService(ContactService)
	SetEmailService(EmailService)
	SetInteractionEventService(InteractionEventService)
	SetOrganizationService(OrganizationService)
	IsInitialized() bool

	ExtractEmails(s string) []string
	GetEmailsForProcessingForUser(ctx context.Context, tenant, userEmailAddress string)
	LoadEmail(ctx context.Context, rawEmail *entity.RawEmail) (EmailMessageData, error)
	ProcessEmailCheck(ctx context.Context, tenant string, email *EmailMessageData) HeaderAnalysis
	ProcessEmail(ctx context.Context, tenant string, emailId uuid.UUID) entity.UpdateRawEmailTable
	ProcessEmailByMessageId(ctx context.Context, tenant, usernameSource, messageId string) entity.UpdateRawEmailTable
	SendMail(ctx context.Context, emailMessage *entity.EmailMessage) error
	ProcessSentEmail(ctx context.Context, tx *neo4j.ManagedTransaction, emailMessage *entity.EmailMessage) (*string, error)
	GetEmailIdForEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, tenant, email string, source string) (string, error)
}

type MailboxDetails

type MailboxDetails struct {
	Email             string   `json:"email"`
	ForwardingEnabled bool     `json:"forwardingEnabled"`
	ForwardingTo      []string `json:"forwardingTo"`
	WebmailEnabled    bool     `json:"webmailEnabled"`
}

type MailboxService

type MailboxService interface {
	CreateMailbox(ctx context.Context, tx *gorm.DB, request CreateMailboxRequest) error
	IsDomainAvailable(ctx context.Context, domain string) (ok, available bool)
	RecommendOutboundDomains(ctx context.Context, domainRoot string, count int) []string
	ReputationScore(ctx context.Context, domain, tenant string) (int, error)
}

type MailstackService

type MailstackService interface {
	GetPaymentIntent(ctx context.Context, domains []string, usernames []string, amount int64) (string, error)                                                   // stripe client secret
	RegisterBuyDomainsWithMailboxes(ctx context.Context, test bool, paymentIntentId string, domains []string, usernames []string, redirectWebsite string) error // id, stripe client secret
	GetTenantForMailstackDomain(ctx context.Context, domain string) (string, error)
	// key domain, value tenant
	GetAllMailstackDomains(ctx context.Context) (map[string]string, error)
	ConfigureMailstackDomain(ctx context.Context, domain, redirectWebsite string) error
}

type MarkdownEventService

type MarkdownEventService interface {
	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, input data_fields.MarkdownEventFields) (string, error)
}

type NamecheapDomainInfo

type NamecheapDomainInfo struct {
	DomainName  string   `json:"domainName"`
	CreatedDate string   `json:"createdDate"`
	ExpiredDate string   `json:"expiredDate"`
	Nameservers []string `json:"nameservers"`
	WhoisGuard  bool     `json:"whoisGuard"`
}

type NamecheapService

type NamecheapService interface {
	CheckDomainAvailability(ctx context.Context, domain string) (bool, bool, error)
	PurchaseDomain(ctx context.Context, tenant, domain string) error
	GetDomainPrice(ctx context.Context, domain string) (float64, error)
	GetDomainInfo(ctx context.Context, tenant, domain string) (NamecheapDomainInfo, error)
	UpdateNameservers(ctx context.Context, tenant, domain string, nameservers []string) error
}

type NotifiableUser

type NotifiableUser struct {
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	Email        string `json:"email"`
	SubscriberID string `json:"subscriberId"` // must be unique uuid for user
}

type NotificationService

type NotificationService interface {
	NotifySlackChannel(ctx context.Context, tenant, channelID string, message *string) error
}

type NovuNotification

type NovuNotification struct {
	WorkflowId   string
	TemplateData map[string]string

	To      *NotifiableUser
	Subject string
	Payload map[string]interface{}
}

type NovuService

type NovuService interface {
	SendNotification(ctx context.Context, notification *NovuNotification) error
}

type OpenSrsService

type OpenSrsService interface {
	SendEmail(ctx context.Context, request *entity.EmailMessage) error
	SetupDomain(ctx context.Context, tenant, domain string) error
	SetupMailbox(ctx context.Context, tenant, username, password string, forwardingTo []string, webmailEnabled bool) error
	GetMailboxDetails(ctx context.Context, email string) (MailboxDetails, error)
}

type OpportunityService

type OpportunityService interface {
	SetContractService(contract ContractService)
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	GetById(ctx context.Context, tx *neo4j.ManagedTransaction, tenant, opportunityId string) (*neo4jentity.OpportunityEntity, error)
	GetOpportunitiesForContracts(ctx context.Context, tenant string, contractIds []string) (*neo4jentity.OpportunityEntities, error)
	GetOpportunitiesForOrganizations(ctx context.Context, tenant string, organizationIds []string) (*neo4jentity.OpportunityEntities, error)
	GetPaginatedOrganizationOpportunities(ctx context.Context, tenant string, page int, limit int) (*utils.Pagination, error)

	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, opportunityId *string, input *data_fields.OpportunityFields) (string, error)
	CreateRenewalOpportunity(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, input *data_fields.OpportunityFields) (string, error)
	CloseWon(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, tenant, opportunityId string) error
	CloseLost(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, tenant, opportunityId string) error
	Archive(ctx context.Context, tenant, opportunityId string) error

	RolloutRenewalOpportunity(ctx context.Context, contractId string) error
}

type OrganizationData

type OrganizationData struct {
	Name             string               `json:"name"`
	Domain           string               `json:"domain"`
	ShortDescription string               `json:"description"`
	LongDescription  string               `json:"longDescription"`
	Website          string               `json:"website"`
	Employees        int64                `json:"employees"`
	FoundedYear      int64                `json:"foundedYear"`
	Public           *bool                `json:"public,omitempty"`
	Logos            []string             `json:"logos"`
	Icons            []string             `json:"icons"`
	Industry         string               `json:"industry"`
	Socials          []OrganizationSocial `json:"socials"`
	Location         OrganizationLocation `json:"location"`
}

type OrganizationLocation

type OrganizationLocation struct {
	IsHeadquarter *bool  `json:"isHeadquarter"`
	Country       string `json:"country"`
	CountryCodeA2 string `json:"countryCodeA2"`
	CountryCodeA3 string `json:"countryCodeA3"`
	Locality      string `json:"locality"`
	Region        string `json:"region"`
	PostalCode    string `json:"postalCode"`
	AddressLine1  string `json:"addressLine1"`
	AddressLine2  string `json:"addressLine2"`
}

func (OrganizationLocation) IsEmpty

func (l OrganizationLocation) IsEmpty() bool

type OrganizationService

type OrganizationService interface {
	SetSocialService(social SocialService)
	IsInitialized() bool

	GetById(ctx context.Context, tenant, organizationId string) (*entity.OrganizationEntity, error)

	CreateFromGlobalOrganization(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, globalOrgId uint64, dataFields data_fields.OrganizationFields) (string, error)
	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, dataFields data_fields.OrganizationFields) (string, error)
	LinkWithDomain(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, organizationId, domain string) (bool, error)
	UnlinkDomain(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, organizationId, domain string) error

	Hide(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, organizationId string) error
	Show(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, organizationId string) error

	AddParentOrganization(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, parentOrganizationId, subOrganizationId, relationType string) error
	RemoveParentOrganization(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, parentOrganizationId, subOrganizationId string) error

	UpdateOnboardingStatus(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, organizationId string, dataFields data_fields.OrganizationOnboardingStatusFields) error

	GetHiddenOrganizationIds(ctx context.Context, hiddenAfter time.Time) ([]string, error)
	GetMergedOrganizationIds(ctx context.Context, mergedAfter time.Time) ([]string, error)
	RequestRefreshLastTouchpoint(ctx context.Context, organizationId string) error
	RefreshLastTouchpoint(ctx context.Context, organizationId string) error
	CheckOrganizationExistsWithEmail(ctx context.Context, email string) (bool, string, error)
	CheckOrganizationExistsWithLinkedIn(ctx context.Context, url, alias, externalId string) (bool, string, error)
	GetPrimaryOrganizationsWithJobRoleForContacts(ctx context.Context, contactIds []string) (*entity.OrganizationWithJobRoleEntities, error)
	ValidateOrganizationExists(ctx context.Context, tx *neo4j.ManagedTransaction, organizationId string) error
}

type OrganizationSocial

type OrganizationSocial struct {
	Url   string `json:"url"`
	Alias string `json:"alias"`
	Id    string `json:"id"`
}

type PersonSearch

type PersonSearch struct {
	LinkedinURL *string
	FirstName   *string
	LastName    *string
	Email       *string
	Domain      *string
	CompanyName *string
}

type PhoneNumberService

type PhoneNumberService interface {
	Merge(ctx context.Context, phoneNumber string, source entity.DataSource) (string, error)
	UpdatePhoneNumberFor(ctx context.Context, entityType model.EntityType, entityId string, phoneId string, label *string, primary *bool) error
	DetachFromEntityByPhoneNumber(ctx context.Context, entityType model.EntityType, entityId, phoneNumber string) (bool, error)
	DetachFromEntityById(ctx context.Context, entityType model.EntityType, entityId, phoneNumberId string) (bool, error)
	GetAllForEntityTypeByIds(ctx context.Context, entityType model.EntityType, ids []string) (*entity.PhoneNumberEntities, error)
	GetById(ctx context.Context, phoneNumberId string) (*entity.PhoneNumberEntity, error)
	GetByPhoneNumber(ctx context.Context, phoneNumber string) (*entity.PhoneNumberEntity, error)
}

type PostmarkEmail

type PostmarkEmail struct {
	WorkflowId    string            `json:"workflowId"`
	MessageStream string            `json:"messageStream"`
	TemplateData  map[string]string `json:"templateData"`
	From          string            `json:"from"`
	To            string            `json:"to"`
	CC            []string          `json:"cc"`
	BCC           []string          `json:"bcc"`
	Subject       string            `json:"subject"`
	Attachments   []PostmarkEmailAttachment
}

type PostmarkEmailAttachment

type PostmarkEmailAttachment struct {
	Filename       string
	ContentEncoded string
	ContentType    string
	ContentID      string
}

type PostmarkService

type PostmarkService interface {
	SendNotification(ctx context.Context, postmarkEmail PostmarkEmail, tenant string) error
	CreateServerIfNotExists(ctx context.Context) error
	DeleteServer(ctx context.Context, tenant string) error
}

type ProfileInfo

type ProfileInfo struct {
	Handle string      `json:"handle"`
	URL    interface{} `json:"url"` // Consider using *string if possible
}

ProfileInfo represents common social media profile attributes

type RegistrationService

type RegistrationService interface {
	SetContactService(contact ContactService)
	SetEmailService(email EmailService)
	SetFlowService(flow FlowService)
	SetMailboxService(mailbox MailboxService)
	SetOrganizationService(org OrganizationService)
	IsInitialized() bool

	PrepareDefaultTenantSetup(ctx context.Context, loggedInUserEmail string) error
	ConfigureTestMailbox(ctx context.Context) (*TestUserSetup, error)
	ConfigureDefaultFlowData(ctx context.Context, testUser *TestUserSetup) error
	CreatePostmarkServer(ctx context.Context) error
}

type ReminderService

type ReminderService interface {
	CreateReminder(ctx context.Context, tenant, userId, orgId, content string, dueDate time.Time) (string, error)
	UpdateReminder(ctx context.Context, tenant, id string, content *string, dueDate *time.Time, dismissed, sent *bool) error
	GetReminderById(ctx context.Context, id string) (*entity.ReminderEntity, error)
	RemindersForOrganization(ctx context.Context, organizationID string, dismissed *bool) ([]*entity.ReminderEntity, error)

	SendNotification(ctx context.Context, reminderId, fronteraPublicPath string) error
}

type ServiceLineItemService

type ServiceLineItemService interface {
	SetContractService(contract ContractService)
	IsInitialized() bool

	GetById(ctx context.Context, id string) (*neo4jentity.ServiceLineItemEntity, error)
	GetServiceLineItemsByParentId(ctx context.Context, sliParentId string) (*neo4jentity.ServiceLineItemEntities, error)
	GetServiceLineItemsForContract(ctx context.Context, contractId string) (*neo4jentity.ServiceLineItemEntities, error)
	GetServiceLineItemsForContracts(ctx context.Context, contractIds []string) (*neo4jentity.ServiceLineItemEntities, error)
	GetServiceLineItemsForInvoiceLines(ctx context.Context, invoiceLineIds []string) (*neo4jentity.ServiceLineItemEntities, error)
	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, dataFields data_fields.SLIFields) (string, error)
	Pause(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, serviceLineItemId string) error
	Resume(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, serviceLineItemId string) error
	Delete(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, serviceLineItemId string) error
	Close(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, serviceLineItemId string, endedAt time.Time) error
}

type SimulateInvoiceRequestData

type SimulateInvoiceRequestData struct {
	ContractId   string
	ServiceLines []SimulateInvoiceRequestServiceLineData
}

type SimulateInvoiceRequestServiceLineData

type SimulateInvoiceRequestServiceLineData struct {
	Key               string
	ServiceLineItemID string
	ParentID          string
	Description       string
	Comments          string
	BillingCycle      neo4jenum.BilledType
	Price             float64
	Quantity          int64
	ServiceStarted    time.Time
	ServiceEnded      *time.Time
	TaxRate           *float64
	Canceled          bool
}

type SimulateInvoiceResponseData

type SimulateInvoiceResponseData struct {
	Invoice *neo4jentity.InvoiceEntity
	Lines   []*neo4jentity.InvoiceLineEntity
}

type SlackService

type SlackService interface {
	GetSlackChannels(ctx context.Context, tenant string) ([]*entity.SlackChannel, error)
	GetPaginatedSlackChannels(ctx context.Context, tenant string, page, limit int) ([]*entity.SlackChannel, int64, error)
	StoreSlackChannel(ctx context.Context, tenant, source, channelId, channelName string, organizationId *string) error
}

type SnitcherDataResponse

type SnitcherDataResponse struct {
	Status       string          `json:"status"`
	Message      string          `json:"message,omitempty"`
	CompanyFound bool            `json:"companyFound"`
	Data         *CompanyDetails `json:"data,omitempty"`
}

type SnitcherResponse

type SnitcherResponse struct {
	Fuzzy   bool            `json:"fuzzy"`
	Domain  string          `json:"domain"`
	Type    string          `json:"type"`
	Company *CompanyDetails `json:"company"`
}

SnitcherResponse represents the top-level response structure

func (*SnitcherResponse) CompanyDomain

func (s *SnitcherResponse) CompanyDomain() string

func (*SnitcherResponse) CompanyFound

func (s *SnitcherResponse) CompanyFound() bool

func (*SnitcherResponse) CompanyName

func (s *SnitcherResponse) CompanyName() string

func (*SnitcherResponse) CompanyWebsite

func (s *SnitcherResponse) CompanyWebsite() string

func (*SnitcherResponse) LinkedinSlug

func (s *SnitcherResponse) LinkedinSlug() string

type SocialProfiles

type SocialProfiles struct {
	Crunchbase *ProfileInfo `json:"crunchbase"`
	LinkedIn   *ProfileInfo `json:"linkedin"`
	Facebook   *ProfileInfo `json:"facebook"`
}

SocialProfiles contains social media profile information

type SocialService

type SocialService interface {
	SetContactService(contact ContactService)
	IsInitialized() bool

	GetById(ctx context.Context, socialId string) (*entity.SocialEntity, error)
	AddSocialToEntity(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, linkWith common_srv.LinkWith, socialEntity entity.SocialEntity) (string, error)
	RemoveSocialFromEntity(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, linkWith common_srv.LinkWith, socialId string) error
	Update(ctx context.Context, entity entity.SocialEntity) (*entity.SocialEntity, error)
	PermanentlyDelete(ctx context.Context, tenant, socialId string) error
	GetAllForEntities(ctx context.Context, tenant string, linkedEntityType model.EntityType, linkedEntityIds []string) (*entity.SocialEntities, error)
	GetAllLinkedinForEntities(ctx context.Context, tenant string, linkedEntityType model.EntityType, linkedEntityIds []string) (*entity.SocialEntities, error)
}

type TagService

type TagService interface {
	Save(ctx context.Context, tx *neo4j.ManagedTransaction, inputTag *neo4jentity.TagEntity) (*neo4jentity.TagEntity, error)
	AddTagToEntity(ctx context.Context, tx *neo4j.ManagedTransaction, tenant, entityId string, entityType model.EntityType, tagId, tagName string) (string, error)
	RemoveTagFromEntity(ctx context.Context, tx *neo4j.ManagedTransaction, tenant, entityId string, entityType model.EntityType, tagId string) error
	Update(ctx context.Context, tagId string, name, colorCode *string) error
	UnlinkAndDelete(ctx context.Context, id string) (bool, error)
	GetAll(ctx context.Context) (*neo4jentity.TagEntities, error)
	GetById(ctx context.Context, tagId string) (*neo4jentity.TagEntity, error)
	GetTagByEntityTypeAndName(ctx context.Context, entityType model.EntityType, name string) (*neo4jentity.TagEntity, error)
	GetTagsByEntityType(ctx context.Context, entityType model.EntityType) (*neo4jentity.TagEntities, error)
	GetTagsForContacts(ctx context.Context, contactIds []string) (*neo4jentity.TagEntities, error)
	GetTagsForIssues(ctx context.Context, issueIds []string) (*neo4jentity.TagEntities, error)
	GetTagsForOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.TagEntities, error)
	GetTagsForLogEntries(ctx context.Context, logEntryIds []string) (*neo4jentity.TagEntities, error)
}

type TenantService

type TenantService interface {
	GetAllTenants(ctx context.Context) ([]*entity.TenantEntity, error)
	GetTenantForUserEmail(ctx context.Context, email string) (*entity.TenantEntity, error)
	Merge(ctx context.Context, tenantEntity entity.TenantEntity) (*entity.TenantEntity, error)
	HardDelete(ctx context.Context, tenant string) error
}

type TenantSettingsService

type TenantSettingsService interface {
	GetTenantSettings(ctx context.Context) (*neo4jentity.TenantSettingsEntity, error)
	GetTenantSettingsForTenant(ctx context.Context, tenant string) (*neo4jentity.TenantSettingsEntity, error)
	UpdateTenantSettings(ctx context.Context, dataFields data_fields.TenantSettingsFields) error

	CreateBankAccount(ctx context.Context, dataFields data_fields.BankAccountFields) (string, error)
	UpdateBankAccount(ctx context.Context, bankAccountId string, dataFields data_fields.BankAccountFields) error
	DeleteBankAccount(ctx context.Context, bankAccountId string) error

	GetTenantBillingProfiles(ctx context.Context) (*neo4jentity.TenantBillingProfileEntities, error)
	GetTenantBillingProfile(ctx context.Context, id string) (*neo4jentity.TenantBillingProfileEntity, error)
	GetDefaultTenantBillingProfile(ctx context.Context) (*neo4jentity.TenantBillingProfileEntity, error)
	CreateTenantBillingProfile(ctx context.Context, dataFields data_fields.TenantBillingProfileFields) (string, error)
	UpdateTenantBillingProfile(ctx context.Context, profileId string, dataFields data_fields.TenantBillingProfileFields) error
}

type TestUserSetup

type TestUserSetup struct {
	UserId         string
	MailboxAddress string
}

type UserService

type UserService interface {
	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, userFields data_fields.UserFields) (string, error)

	GetById(ctx context.Context, userId string) (*neo4jentity.UserEntity, error)
	GetAllUsersForTenant(ctx context.Context, tenant string) ([]*neo4jentity.UserEntity, error)
	FindUserByEmail(parentCtx context.Context, email string) (*neo4jentity.UserEntity, error)
	IsOwner(ctx context.Context, id string) (bool, error)
	GetContactOwner(ctx context.Context, contactId string) (*neo4jentity.UserEntity, error)
	GetNoteCreator(ctx context.Context, noteId string) (*neo4jentity.UserEntity, error)
	GetUsersConnectedForContacts(ctx context.Context, contactIds []string) (*neo4jentity.UserEntities, error)
	GetUsersForEmails(ctx context.Context, emailIds []string) (*neo4jentity.UserEntities, error)
	GetUsersForPhoneNumbers(ctx context.Context, phoneNumberIds []string) (*neo4jentity.UserEntities, error)
	GetUserOwnersForOrganizations(ctx context.Context, organizationIDs []string) (*neo4jentity.UserEntities, error)
	GetUserOwnersForOpportunities(ctx context.Context, opportunityIds []string) (*neo4jentity.UserEntities, error)
	GetUserCreatorsForOpportunities(ctx context.Context, opportunityIds []string) (*neo4jentity.UserEntities, error)
	GetUserCreatorsForServiceLineItems(ctx context.Context, serviceLineItemIds []string) (*neo4jentity.UserEntities, error)
	GetUsersWithMailboxes(ctx context.Context) (*neo4jentity.UserEntities, error)
	GetUserCreatorsForContracts(ctx context.Context, contractIds []string) (*neo4jentity.UserEntities, error)
	GetUserAuthorsForLogEntries(ctx context.Context, logEntryIDs []string) (*neo4jentity.UserEntities, error)
	GetUserAuthorsForComments(ctx context.Context, commentIds []string) (*neo4jentity.UserEntities, error)
	GetUserForFlowSenders(ctx context.Context, flowSenderIds []string) (*neo4jentity.UserEntities, error)
	GetUsers(ctx context.Context, userIds []string) (*neo4jentity.UserEntities, error)
	GetAllOwnersForOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.UserEntities, error)
	GetDistinctOrganizationOwners(ctx context.Context) (*neo4jentity.UserEntities, error)
	GetReminderOwner(ctx context.Context, reminderId string) (*neo4jentity.UserEntity, error)
	GetContractOwner(ctx context.Context, contractId string) (*neo4jentity.UserEntity, error)
}

type ValidateEmailMailSherpaData

type ValidateEmailMailSherpaData struct {
	Email  string `json:"email"`
	Syntax struct {
		IsValid    bool   `json:"isValid"`
		User       string `json:"user"`
		Domain     string `json:"domain"`
		CleanEmail string `json:"cleanEmail"`
	} `json:"syntax"`
	DomainData struct {
		IsFirewalled          bool   `json:"isFirewalled"`
		Provider              string `json:"provider"`
		SecureGatewayProvider string `json:"secureGatewayProvider"`
		IsCatchAll            bool   `json:"isCatchAll"`
		CanConnectSMTP        bool   `json:"canConnectSMTP"`
		HasMXRecord           bool   `json:"hasMXRecord"`
		HasSPFRecord          bool   `json:"hasSPFRecord"`
		TLSRequired           bool   `json:"tlsRequired"`
		ResponseCode          string `json:"responseCode"`
		ErrorCode             string `json:"errorCode"`
		Description           string `json:"description"`
		IsPrimaryDomain       bool   `json:"isPrimaryDomain"`
		PrimaryDomain         string `json:"primaryDomain"`
	} `json:"domainData"`
	EmailData struct {
		SkippedValidation bool   `json:"skippedValidation"` // if true, email validation was skipped
		Deliverable       string `json:"deliverable"`
		IsMailboxFull     bool   `json:"isMailboxFull"`
		IsRoleAccount     bool   `json:"isRoleAccount"`
		IsSystemGenerated bool   `json:"isSystemGenerated"`
		IsFreeAccount     bool   `json:"isFreeAccount"`
		SmtpSuccess       bool   `json:"smtpSuccess"`
		ResponseCode      string `json:"responseCode"`
		ErrorCode         string `json:"errorCode"`
		Description       string `json:"description"`
		RetryValidation   bool   `json:"retryValidation"` // if true, email validation should be retried
		TLSRequired       bool   `json:"tlsRequired"`
		AlternateEmail    string `json:"alternateEmail"`
	} `json:"emailData"`
}

type VerifyService

type VerifyService interface {
	Threats(ctx context.Context, ipAddress string) (*IpThreats, error)
	IdentifyCompanyDomain(ctx context.Context, ipAddress string) (*string, error)
	ValidatePhoneNumber(ctx context.Context, countryCodeA2 string, phoneNumber string) (*string, *string, error)
	ValidateEmail(ctx context.Context, email string) (*ValidateEmailMailSherpaData, error)
	ValidateEmailWithMailSherpa(ctx context.Context, email string) (*ValidateEmailMailSherpaData, error)
	ValidateEmailScrubby(ctx context.Context, email string) (string, error)
	ValidateEmailWithTrueinbox(ctx context.Context, email string) (*entity.TrueInboxResponseBody, error)
	ValidateEmailWithEnrow(ctx context.Context, email string, extendedWaitingTimeForResponse bool) (string, error)

	LookupIp(ctx context.Context, ip string) (*entity.IPDataResponseBody, error)

	ValidateUsAddress(address string) (*extract.Lookup, error)
	ValidateInternationalAddress(address, country string) (*international_street.Lookup, error)
}

type WorkflowService

type WorkflowService interface {
	// Flow
	SaveFlow(ctx context.Context, flowRecord entity.Flows) (*entity.Flows, error)
	GetFlowsByTrigger(ctx context.Context, listenerEvent enum.FlowListenerEvent) ([]entity.Flows, error)
	GetNextStepInFlow(ctx context.Context, flowId string, fromNodeId *string) (*FlowNextStep, error)
	GetFlowsForListenerEvent(ctx context.Context, sourceEvent enum.FlowListenerEvent, eventType string, eventData any) ([]entity.Flows, error)

	// Flow Execution
	BuildAndSaveFlowExecutionRecord(ctx context.Context, flowStatus, flowId, flowNodeId, entityId, entityType, currentStep string, eventData any) (*entity.FlowExecution, error)
	SaveFlowExecutionRecord(ctx context.Context, flowExecutionRecord entity.FlowExecution) (*entity.FlowExecution, error)
	GetFlowExecutionRecordById(ctx context.Context, id string) (*entity.FlowExecution, error)

	// FlowAgent Execution
	SaveFlowAgentExecutionRecord(ctx context.Context, flowAgentExecutionRecord entity.AgentExecution) (*entity.AgentExecution, error)

	// Validation
	ValidateEventType(ctx context.Context, nodeType enum.FlowNodeType, event string) bool
	ValidateFlowBelongsToTenant(ctx context.Context, flowId string) (bool, error)
	ValidateListener(ctx context.Context, listenerEvent enum.FlowListenerEvent) (bool, error)
	ValidateNodeType(ctx context.Context, nodeType string) (bool, *enum.FlowNodeType)
	ValidateTransition(ctx context.Context, fromNodeId string, toNodeId string) (bool, error)
}

type WorkspaceService

type WorkspaceService interface {
	MergeToTenant(ctx context.Context, workspaceEntity entity.WorkspaceEntity, tenant string) (bool, error)
	GetWorkspaceDomainsForTenant(ctx context.Context) ([]string, error)
	CheckEmailBelongsToTenant(ctx context.Context, email string) (bool, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL