service

package
v0.0.0-...-665dad4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 95 Imported by: 37

Documentation

Index

Constants

View Source
const (
	//TODO rework all of this
	WorkflowIdOrgOwnerUpdateEmail                  = "org-owner-update-email"
	WorkflowIdOrgOwnerUpdateAppNotification        = "org-owner-update-in-app-notification"
	WorkflowIdOrgOwnerUpdateEmailSubject           = "%s %s added you as an owner"
	WorkflowIdOrgOwnerUpdateAppNotificationSubject = "%s %s added you as an owner"

	WorkflowFailedWebhookSubject = "[Action Required] Webhook %s is offline"

	WorkflowReminderNotificationSubject = "Reminder, %s"
	WorkflowReminderNotificationEmail   = "reminder-notification-email"
	WorkflowReminderInAppNotification   = "reminder-in-app-notification"

	WorkflowId_FlowParticipantGoalAchievedEmail = "flow-participant-goal-achieved-email"
)
View Source
const (
	PostmarkMessageStreamMagicLink = string(commonenum.WorkspaceProviderMagicLink)
	PostmarkMessageStreamInvoice   = "invoices"
)
View Source
const (
	WorkflowMagicLinkSubject = "One click away from CustomerOS"
	WorkflowMagicLink        = string(commonenum.WorkspaceProviderMagicLink)

	WorkflowInvoicePaid                  = "invoice-paid"
	WorkflowInvoicePaymentReceived       = "invoice-payment-received"
	WorkflowInvoiceReadyWithPaymentLink  = "invoice-ready"
	WorkflowInvoiceReadyNoPaymentLink    = "invoice-ready-nolink"
	WorkflowInvoiceVoided                = "invoice-voided"
	WorkflowFailedWebhook                = "failed-webhook"
	WorkflowInvoiceRemindWithPaymentLink = "invoice-remind"
	WorkflowInvoiceRemindNoPaymentLink   = "invoice-remind-nolink"

	WorkflowInvoiceVoidedSubject          = "Voided Invoice %s"
	WorkflowInvoicePaidSubject            = "Paid Invoice %s from %s"
	WorkflowInvoicePaymentReceivedSubject = "Payment Received for Invoice %s from %s"
	WorkflowInvoiceReadySubject           = "New invoice %s"
	WorkflowInvoiceRemindSubject          = "Follow-Up: Overdue Invoice %s"
)
View Source
const (
	NotificationsExchangeName = "notifications"
	NotificationRoutingKey    = "notification"

	EventsExchangeName                      = "customeros"
	EventsRoutingKey                        = "event"
	EventsQueueName                         = "events"
	EventsFlowParticipantScheduleQueueName  = "events-flow-participant-schedule"
	EventsFlowParticipantScheduleRoutingKey = "flow-participant-schedule"
	EventsOpensearchQueueName               = "events-opensearch"
)
View Source
const (
	DEFAULT_API_TIMEOUT = 30 // seconds
)
View Source
const DefaultNotificationCooldownInHours = 12
View Source
const TEST_MAILBOX_DOMAIN = "testcustomeros.com"

Variables

View Source
var REQUIRED_TEMPLATE_VALUES = map[string][]string{
	WorkflowIdOrgOwnerUpdateEmail: {
		"{{userFirstName}}",
		"{{actorFirstName}}",
		"{{actorLastName}}",
		"{{orgName}}",
		"{{orgLink}}",
	},
	WorkflowFailedWebhook: {
		"{{userFirstName}}",
		"{{webhookName}}",
		"{{webhookUrl}}",
	},
	WorkflowReminderNotificationEmail: {
		"{{reminderContent}}",
		"{{reminderCreatedAt}}",
		"{{orgName}}",
		"{{orgLink}}",
	},
}

Functions

func CheckSharedPresetsExist

func CheckSharedPresetsExist(viewDefs []postgresEntity.TableViewDefinition) bool

func DefaultTableViewDefinitionContacts

func DefaultTableViewDefinitionContacts(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionContracts

func DefaultTableViewDefinitionContracts(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionCustomers

func DefaultTableViewDefinitionCustomers(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionFlowContacts

func DefaultTableViewDefinitionFlowContacts(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionFlowContactsV2

func DefaultTableViewDefinitionFlowContactsV2(span opentracing.Span, flowId string) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionFlows

func DefaultTableViewDefinitionFlows(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionOpportunities

func DefaultTableViewDefinitionOpportunities(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionOpportunitiesRecords

func DefaultTableViewDefinitionOpportunitiesRecords(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionOrganization

func DefaultTableViewDefinitionOrganization(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionPastInvoices

func DefaultTableViewDefinitionPastInvoices(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionTargetOrganizationsContacts

func DefaultTableViewDefinitionTargetOrganizationsContacts(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionTargets

func DefaultTableViewDefinitionTargets(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitionUpcomingInvoices

func DefaultTableViewDefinitionUpcomingInvoices(span opentracing.Span) (postgresEntity.TableViewDefinition, error)

func DefaultTableViewDefinitions

func DefaultTableViewDefinitions(hasSharedPresets bool, span opentracing.Span) []postgresEntity.TableViewDefinition

ColumnView represents a column in a table view with type and width.

func HTMLToPlainText

func HTMLToPlainText(html string) (string, error)

func IsDayInRange

func IsDayInRange(day, dayRange string) bool

Helper function to check if a day is within a day range like "Mon-Wed"

func NewPostmarkAPIClient

func NewPostmarkAPIClient(baseURL, apiKey string) *postmarkApiClient

NewAPIClient creates a new instance of postmarkApiClient.

func PublishCompletedEvents

func PublishCompletedEvents(options ...ServiceOptions) bool

Types

type AIService

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

func NewAIService

func NewAIService(config *config.GlobalConfig, services *Services) AIService

type ActionLikelihoodMetadata

type ActionLikelihoodMetadata struct {
	Likelihood string `json:"likelihood"`
	Reason     string `json:"reason"`
}

type ActionService

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

func NewActionService

func NewActionService(log logger.Logger, services *Services) ActionService

type ActionStatusMetadata

type ActionStatusMetadata struct {
	Status       string `json:"status"`
	ContractName string `json:"contract-name"`
	Comment      string `json:"comment"`
}

type AgentCapabilities

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

type AgentConfig

type AgentConfig struct {
	Websites                    []string `json:"websites" validate:"required"`
	SlackEnabled                bool     `json:"slackEnabled"`
	SlackChannelID              string   `json:"slackChannelId,omitempty"`
	NotificationCooldownInHours int      `json:"notificationCooldownHours"`
}

type AgentICPQualificationService

type AgentICPQualificationService interface {
}

func NewAgentICPQualificationService

func NewAgentICPQualificationService(services *Services) AgentICPQualificationService

type AgentVisitorIDService

type AgentVisitorIDService interface {
	CreateAgent(ctx context.Context) (*entity.Agents, error)
	RunAgent(ctx context.Context, agent *entity.Agents, eventData *data_fields.WebsiteVisitEvent) error
	SaveAgentConfig(ctx context.Context, agent *entity.Agents, agentConfig AgentConfig) (*entity.Agents, error)
	AgentConfig(ctx context.Context, agent *entity.Agents) (*AgentConfig, error)
	AgentCapabilities(ctx context.Context, agent *entity.Agents) (*AgentCapabilities, error)
	SetReferrerQueryParams(ctx context.Context, queryParams []ReferrerQueryParams) (*string, error)
	ReferrerQueryParams(ctx context.Context, session *entity.WebSession) ([]ReferrerQueryParams, error)
}

func NewAgentVisitorIDService

func NewAgentVisitorIDService(services *Services) AgentVisitorIDService

type AttachmentService

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

func NewAttachmentService

func NewAttachmentService(services *Services) AttachmentService

type AzureService

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

func NewAzureService

func NewAzureService(cfg *config.AzureOAuthConfig, repositories *postgresRepository.Repositories, services *Services) AzureService

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)
}

func NewCloudflareService

func NewCloudflareService(log logger.Logger, services *Services, cfg *config.GlobalConfig) CloudflareService

NewCloudflareService initializes the CloudflareService

type CommentService

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

func NewCommentService

func NewCommentService(log logger.Logger, services *Services) CommentService

type CommonService

type CommonService interface {
}

func NewCommonService

func NewCommonService(services *Services) CommonService

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"`
}

type ContactService

type ContactService interface {
	Save(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, id *string, contactFields data_fields.ContactFields, updateOnlyIfEmpty bool, options ...ServiceOptions) (string, error)
	CreateContactByLinkedIn(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, linkedInUrl string, options ...ServiceOptions) (string, error)
	CreateContactWithOrganizationByEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, email string) (string, error)
	CreateContactByEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, email string, options ...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) (*neo4jentity.ContactEntity, error)
	GetContactsByIds(ctx context.Context, contactIds []string) ([]*neo4jentity.ContactEntity, error)
	SetPrimaryJobRole(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, contactId string, primaryOrganizationId *string) error
	GetFirstContactByEmail(ctx context.Context, email string) (*neo4jentity.ContactEntity, error)
}

func NewContactService

func NewContactService(log logger.Logger, services *Services) ContactService

type ContractService

type ContractService interface {
	GetById(ctx context.Context, contactId string) (*neo4jentity.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
}

func NewContractService

func NewContractService(log logger.Logger, services *Services) ContractService

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)
}

func NewCurrencyService

func NewCurrencyService(repositories *postgresRepository.Repositories) CurrencyService

type CustomFieldTemplateService

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

func NewCustomFieldTemplateService

func NewCustomFieldTemplateService(log logger.Logger, services *Services) CustomFieldTemplateService

type DNSConfig

type DNSConfig struct {
	RecordType string
	Name       string
	Content    string
	Proxied    bool
	TTL        int
	Priority   *int
}

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 DNSResponse

type DNSResponse struct {
	Success bool        `json:"success"`
	Result  []DNSRecord `json:"result"`
}

type DomainService

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

func NewDomainService

func NewDomainService(log logger.Logger, services *Services) DomainService

type DraftResponse

type DraftResponse struct {
	Id string `json:"id"`
}

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    neo4jentity.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 {
	Merge(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, tenant string, emailFields EmailFields, linkWith *LinkWith) (*string, error)
	ReplaceEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, previousEmail string, emailFields EmailFields, linkWith LinkWith) (*string, error)
	UnlinkEmail(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, email, appSource string, linkWith LinkWith) error
	DeleteOrphanEmail(ctx context.Context, emailId string) error
	GetAllEmailsForEntityIds(ctx context.Context, tenant string, entityType commonmodel.EntityType, entityIds []string) (*neo4jentity.EmailEntities, error)
	SetPrimary(ctx context.Context, email string, forEntity LinkWith) error
	GetPrimaryEmailForEntityId(ctx context.Context, entityType commonmodel.EntityType, entityId string) (*neo4jentity.EmailEntity, error)
	GetPrimaryEmailsForEntityIds(ctx context.Context, entityType commonmodel.EntityType, entityIds []string) (*neo4jentity.EmailEntities, error)

	UpdateEmailValidationDetails(ctx context.Context, emailId string, validationFields data_fields.EmailValidationFields) error
	RequestEmailValidation(ctx context.Context, emailId string) error
	// contains filtered or unexported methods
}

func NewEmailService

func NewEmailService(services *Services) EmailService

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)
}

func NewEmailingService

func NewEmailingService(log logger.Logger, services *Services) EmailingService

type EnrichmentService

type EnrichmentService interface {
	Snitcher(ctx context.Context, ipAddress string) (*SnitcherDataResponse, error)
}

func NewEnrichmentService

func NewEnrichmentService(services *Services, config *config.GlobalConfig) EnrichmentService

type EventHandler

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

type ExternalSystemService

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

func NewExternalSystemService

func NewExternalSystemService(log logger.Logger, services *Services) ExternalSystemService

type FlowComputeParticipantsRequirementsInput

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

type FlowExecutionService

type FlowExecutionService interface {
	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
}

func NewFlowExecutionService

func NewFlowExecutionService(services *Services) FlowExecutionService

type FlowListenerEventRecord

type FlowListenerEventRecord struct {
	System      string `json:"system"`
	Event       string `json:"event"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type FlowNextStep

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

type FlowService

type FlowService interface {
	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, txWithPostCommit *utils.TxWithPostCommit, 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
}

func NewFlowService

func NewFlowService(services *Services) FlowService

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"`
}

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 postgresEntity.OAuthTokenEntity) (*gmail.Service, error)
	GetGCalServiceWithOauthToken(ctx context.Context, tokenEntity postgresEntity.OAuthTokenEntity) (*calendar.Service, error)

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

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

func NewGoogleService

func NewGoogleService(cfg *config.GoogleOAuthConfig, postgresRepositories *postgresRepository.Repositories, services *Services) GoogleService

type GraphTraversalIterative

type GraphTraversalIterative struct {
	// contains filtered or unexported fields
}

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) (*neo4jentity.IndustryEntities, error)
	GetInUseIndustries(ctx context.Context) (*neo4jentity.IndustryEntities, error)
	GetByCode(ctx context.Context, code string) (*neo4jentity.IndustryEntity, error)
	GetClosestByCode(ctx context.Context, code string) (*neo4jentity.IndustryEntity, error)
}

func NewIndustryService

func NewIndustryService(log logger.Logger, services *Services) IndustryService

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 {
	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)
}

func NewInteractionEventService

func NewInteractionEventService(services *Services) InteractionEventService

type InteractionSessionService

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

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

func NewInteractionSessionService

func NewInteractionSessionService(services *Services) InteractionSessionService

type InvoiceActionMetadata

type InvoiceActionMetadata struct {
	Status        string  `json:"status"`
	Currency      string  `json:"currency"`
	Amount        float64 `json:"amount"`
	InvoiceNumber string  `json:"number"`
	InvoiceId     string  `json:"id"`
}

type InvoiceService

type InvoiceService interface {
	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)
}

func NewInvoiceService

func NewInvoiceService(services *Services) InvoiceService

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 {
	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
}

func NewIssueService

func NewIssueService(log logger.Logger, services *Services) IssueService

type JobRoleService

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

func NewJobRoleService

func NewJobRoleService(services *Services) JobRoleService

type LinkWith

type LinkWith struct {
	Type         model.EntityType `json:"type"`
	Id           string           `json:"id"`
	Relationship string           `json:"relationship"`
}

func (LinkWith) IsContact

func (l LinkWith) IsContact() bool

func (LinkWith) IsOrganization

func (l LinkWith) IsOrganization() bool

type ListServersResponse

type ListServersResponse struct {
	TotalCount int             `json:"TotalCount"`
	Servers    []ServerDetails `json:"Servers"`
}

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
}

type LocationService

type LocationService interface {
	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 *LinkWith) (string, error)
}

func NewLocationService

func NewLocationService(log logger.Logger, services *Services) LocationService

type LogEntryService

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

func NewLogEntryService

func NewLogEntryService(log logger.Logger, services *Services) LogEntryService

type MailRequest

type MailRequest struct {
	Subject string `json:"subject"`
	Body    struct {
		ContentType string `json:"contentType"`
		Content     string `json:"content"`
	} `json:"body"`
	From struct {
		EmailAddress struct {
			Address string `json:"address"`
		} `json:"emailAddress"`
	} `json:"from"`
	ToRecipients  []Recipient `json:"toRecipients"`
	CcRecipients  []Recipient `json:"ccRecipients,omitempty"`
	BccRecipients []Recipient `json:"bccRecipients,omitempty"`
}

type MailService

type MailService interface {
	ExtractEmails(s string) []string
	GetEmailsForProcessingForUser(ctx context.Context, tenant, userEmailAddress string)
	LoadEmail(ctx context.Context, rawEmail *postgresentity.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)
}

func NewMailService

func NewMailService(services *Services) MailService

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)
}

func NewMailboxService

func NewMailboxService(log logger.Logger, services *Services) MailboxService

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
}

func NewMailstackService

func NewMailstackService(cfg *config.GlobalConfig, services *Services) MailstackService

type MarkdownEventService

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

func NewMarkdownEventService

func NewMarkdownEventService(log logger.Logger, services *Services) MarkdownEventService

type MicrosoftEmailHeaderResponse

type MicrosoftEmailHeaderResponse struct {
	OdataContext           string            `json:"@odata.context"`
	OdataEtag              string            `json:"@odata.etag"`
	ID                     string            `json:"id"`
	InternetMessageHeaders map[string]string `json:"internetMessageHeaders"`
}

func (*MicrosoftEmailHeaderResponse) UnmarshalJSON

func (m *MicrosoftEmailHeaderResponse) UnmarshalJSON(data []byte) error

Custom unmarshaler to handle the array of header objects

type MicrosoftRawEmailResponse

type MicrosoftRawEmailResponse struct {
	Id                      string    `json:"id"`
	SentDateTime            time.Time `json:"sentDateTime"`
	InternetMessageId       string    `json:"internetMessageId"`
	Subject                 string    `json:"subject"`
	ConversationId          string    `json:"conversationId"`
	ConversationIndex       string    `json:"conversationIndex"`
	InferenceClassification string    `json:"inferenceClassification"`
	Body                    struct {
		ContentType string `json:"contentType"`
		Content     string `json:"content"`
	} `json:"body"`
	Sender struct {
		EmailAddress struct {
			Name    string `json:"name"`
			Address string `json:"address"`
		} `json:"emailAddress"`
	} `json:"sender"`
	From struct {
		EmailAddress struct {
			Name    string `json:"name"`
			Address string `json:"address"`
		} `json:"emailAddress"`
	} `json:"from"`
	ToRecipients []struct {
		EmailAddress struct {
			Name    string `json:"name"`
			Address string `json:"address"`
		} `json:"emailAddress"`
	} `json:"toRecipients"`
	CcRecipients []struct {
		EmailAddress struct {
			Name    string `json:"name"`
			Address string `json:"address"`
		} `json:"emailAddress"`
	} `json:"ccRecipients"`
	BccRecipients []struct {
		EmailAddress struct {
			Name    string `json:"name"`
			Address string `json:"address"`
		} `json:"emailAddress"`
	} `json:"bccRecipients"`
	ReplyTo []interface{} `json:"replyTo"`
}

type MicrosoftRawEmailsResponse

type MicrosoftRawEmailsResponse struct {
	OdataNextLink string                      `json:"@odata.nextLink"`
	Value         []MicrosoftRawEmailResponse `json:"value"`
}

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
}

func NewNamecheapService

func NewNamecheapService(cfg *config.GlobalConfig, services *Services) NamecheapService

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 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
}

func NewNovuService

func NewNovuService(services *Services) NovuService

type OpenSRSResponse

type OpenSRSResponse struct {
	Success     bool   `json:"success"`
	Error       string `json:"error,omitempty"`
	ErrorNumber int    `json:"error_number,omitempty"`
}

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)
}

func NewOpenSRSService

func NewOpenSRSService(log logger.Logger, services *Services) OpenSrsService

type OpportunityService

type OpportunityService interface {
	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
}

func NewOpportunityService

func NewOpportunityService(log logger.Logger, services *Services) OpportunityService

type OrganizationService

type OrganizationService interface {
	GetById(ctx context.Context, tenant, organizationId string) (*neo4jentity.OrganizationEntity, error)

	CreateFromGlobalOrganization(ctx context.Context, txWithPostCommit *utils.TxWithPostCommit, globalOrgId uint64) (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) (*neo4jentity.OrganizationWithJobRoleEntities, error)
	ValidateOrganizationExists(ctx context.Context, tx *neo4j.ManagedTransaction, organizationId string) error
}

func NewOrganizationService

func NewOrganizationService(services *Services) OrganizationService

type PhoneNumberService

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

func NewPhoneNumberService

func NewPhoneNumberService(services *Services) PhoneNumberService

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
}

func NewPostmarkService

func NewPostmarkService(services *Services) PostmarkService

type ProfileInfo

type ProfileInfo struct {
	Handle string      `json:"handle"`
	URL    interface{} `json:"url"`
}

ProfileInfo represents common social media profile attributes

type RabbitMQService

type RabbitMQService struct {
	// contains filtered or unexported fields
}

func NewRabbitMQService

func NewRabbitMQService(url string, services *Services) RabbitMQService

NewRabbitMQService initializes the RabbitMQ service with connection retry logic

func (*RabbitMQService) Close

func (r *RabbitMQService) Close()

Close closes the RabbitMQ connection and channel

func (*RabbitMQService) ListenQueue

func (r *RabbitMQService) ListenQueue(queueName string)

func (*RabbitMQService) ListenQueueExclusive

func (r *RabbitMQService) ListenQueueExclusive(queueName string)

func (*RabbitMQService) ProcessMessage

func (r *RabbitMQService) ProcessMessage(d amqp091.Delivery) error

func (*RabbitMQService) PublishEvent

func (r *RabbitMQService) PublishEvent(ctx context.Context, entityId string, entityType model.EntityType, message interface{}) error

PublishEvent publishes a message to the given exchange and routing key with automatic reconnection

func (*RabbitMQService) PublishEventCompleted

func (r *RabbitMQService) PublishEventCompleted(ctx context.Context, tenant string, entityId string, entityType model.EntityType, details *utils.EventCompletedDetails)

func (*RabbitMQService) PublishEventCompletedBulk

func (r *RabbitMQService) PublishEventCompletedBulk(ctx context.Context, tenant string, entityIds []string, entityType model.EntityType, details *utils.EventCompletedDetails)

func (*RabbitMQService) PublishEventOnExchange

func (r *RabbitMQService) PublishEventOnExchange(ctx context.Context, entityId string, entityType model.EntityType, message interface{}, exchange, routingKey string) error

func (*RabbitMQService) PublishFlowAgentEvent

func (r *RabbitMQService) PublishFlowAgentEvent(ctx context.Context, event dto.FlowAgentEvent) error

func (*RabbitMQService) PublishFlowAgentEventResult

func (r *RabbitMQService) PublishFlowAgentEventResult(ctx context.Context, event dto.FlowAgentExecutionResultEvent) error

func (*RabbitMQService) PublishMessageOnExchange

func (r *RabbitMQService) PublishMessageOnExchange(ctx context.Context, message interface{}, exchange, routingKey string) error

func (*RabbitMQService) PublishWebhookEvent

func (r *RabbitMQService) PublishWebhookEvent(ctx context.Context, event dto.WebhookEvent) error

func (*RabbitMQService) RegisterHandler

func (r *RabbitMQService) RegisterHandler(eventType interface{}, handler func(ctx context.Context, services *Services, event any) error)

RegisterHandler allows you to register a handler for a specific event type

type Recipient

type Recipient struct {
	EmailAddress struct {
		Address string `json:"address"`
	} `json:"emailAddress"`
}

type ReferrerQueryParams

type ReferrerQueryParams struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
}

type RegistrationService

type RegistrationService interface {
	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
}

func NewRegistrationService

func NewRegistrationService(services *Services) RegistrationService

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) (*neo4jentity.ReminderEntity, error)
	RemindersForOrganization(ctx context.Context, organizationID string, dismissed *bool) ([]*neo4jentity.ReminderEntity, error)

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

func NewReminderService

func NewReminderService(services *Services) ReminderService

type ReplyRequest

type ReplyRequest struct {
	Message MailRequest `json:"message"`
	Comment string      `json:"comment"`
}

type SLIActionMetadata

type SLIActionMetadata struct {
	UserName         string     `json:"user-name"`
	ServiceName      string     `json:"service-name"`
	Price            float64    `json:"price"`
	Currency         string     `json:"currency"`
	Comment          string     `json:"comment"`
	ReasonForChange  string     `json:"reasonForChange"`
	StartedAt        *time.Time `json:"startedAt,omitempty"`
	BilledType       string     `json:"billedType"`
	Quantity         int64      `json:"quantity"`
	PreviousPrice    float64    `json:"previousPrice"`
	PreviousQuantity int64      `json:"previousQuantity"`
}

type SendDraftRequest

type SendDraftRequest struct {
	SaveToSentItems bool `json:"saveToSentItems"`
}

type ServerDetails

type ServerDetails struct {
	ID        int64  `json:"ID"`
	Name      string `json:"Name"`
	APITokens []struct {
		ServerToken string `json:"ServerToken"`
	} `json:"ApiTokens"`
}

type ServerRequest

type ServerRequest struct {
	Name           string `json:"Name"`
	InboundHookUrl string `json:"InboundHookUrl"`
	InboundDomain  string `json:"InboundDomain"`
}

type ServerResponse

type ServerResponse struct {
	ID   int64  `json:"ID"`
	Name string `json:"Name"`
}

ServerResponse represents the response structure from creating a server.

type ServiceLineItemService

type ServiceLineItemService interface {
	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
}

func NewServiceLineItemService

func NewServiceLineItemService(log logger.Logger, services *Services) ServiceLineItemService

type ServiceOptions

type ServiceOptions struct {
	SkipCompletedEvents bool
}

type Services

type Services struct {
	GlobalConfig *config.GlobalConfig
	Cache        *caches.Cache
	Logger       logger.Logger

	PostgresRepositories *postgresRepository.Repositories
	Neo4jRepositories    *neo4jRepository.Repositories

	RabbitMQService RabbitMQService
	GrpcClients     *grpc_client.Clients

	ActionService                ActionService
	AgentICPQualificationService AgentICPQualificationService
	AgentVisitorIDService        AgentVisitorIDService
	AIService                    AIService
	AttachmentService            AttachmentService
	AzureService                 AzureService
	CloudflareService            CloudflareService
	ContactService               ContactService
	ContractService              ContractService
	CommonService                CommonService
	CommentService               CommentService
	CurrencyService              CurrencyService
	CustomFieldTemplateService   CustomFieldTemplateService
	DomainService                DomainService
	EmailService                 EmailService
	EmailingService              EmailingService
	EnrichmentService            EnrichmentService
	ExternalSystemService        ExternalSystemService
	FlowExecutionService         FlowExecutionService
	FlowService                  FlowService
	GoogleService                GoogleService
	IndustryService              IndustryService
	InteractionSessionService    InteractionSessionService
	InteractionEventService      InteractionEventService
	IssueService                 IssueService
	InvoiceService               InvoiceService
	JobRoleService               JobRoleService
	LocationService              LocationService
	LogEntryService              LogEntryService
	MailboxService               MailboxService
	MailService                  MailService
	MailstackService             MailstackService
	MarkdownEventService         MarkdownEventService
	NamecheapService             NamecheapService
	NovuService                  NovuService
	OpenSrsService               OpenSrsService
	OpportunityService           OpportunityService
	OrganizationService          OrganizationService
	PhoneNumberService           PhoneNumberService
	PostmarkService              PostmarkService
	RegistrationService          RegistrationService
	ReminderService              ReminderService
	ServiceLineItemService       ServiceLineItemService
	SlackService                 SlackService
	SocialService                SocialService
	TagService                   TagService
	TenantService                TenantService
	TenantSettingsService        TenantSettingsService
	UserService                  UserService
	VerifyService                VerifyService
	WorkflowService              WorkflowService
	WorkspaceService             WorkspaceService
}

func InitServices

func InitServices(globalConfig *config.GlobalConfig, postgresDB *config.PostgresDB, driver *neo4j.DriverWithContext, neo4jDatabase string, grpcClients *grpc_client.Clients, log logger.Logger) *Services

type SimulateInvoiceLine

type SimulateInvoiceLine struct {
	Key               string
	ServiceLineItemID string
	ParentID          string
	Name              string
	Price             float64
	Quantity          int64
	Amount            float64
	TotalAmount       float64
}

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 SimulateInvoices

type SimulateInvoices struct {
	ContractId         string
	IssueDate          time.Time
	DueDate            time.Time
	InvoicePeriodStart time.Time
	InvoicePeriodEnd   time.Time
	InvoiceNumber      string
	InvoiceLines       []*SimulateInvoiceLine
}

type SlackService

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

func NewSlackService

func NewSlackService(services *Services, config *config.GlobalConfig) SlackService

type SnitcherDataResponse

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

type SocialProfiles

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

type SocialService

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

func NewSocialService

func NewSocialService(log logger.Logger, services *Services) SocialService

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)
}

func NewTagService

func NewTagService(log logger.Logger, services *Services) TagService

type TenantService

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

func NewTenantService

func NewTenantService(log logger.Logger, services *Services) TenantService

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
}

func NewTenantSettingsService

func NewTenantSettingsService(log logger.Logger, services *Services) TenantSettingsService

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)
}

func NewUserService

func NewUserService(service *Services) UserService

type VerifyService

type VerifyService interface {
	Threats(ctx context.Context, ipAddress string) (*IpThreats, error)
	IdentifyCompanyDomain(ctx context.Context, ipAddress string) (*string, error)
}

func NewVerifyService

func NewVerifyService(services *Services, cfg *config.GlobalConfig) VerifyService

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, AgentExecutionRecord 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)
}

func NewWorkflowService

func NewWorkflowService(services *Services) WorkflowService

type WorkspaceService

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

func NewWorkspaceService

func NewWorkspaceService(services *Services) WorkspaceService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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