entity

package
v0.0.0-...-a0cf74a Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterOutEmpty

func FilterOutEmpty(emails []string) []string

Types

type ActionType

type ActionType string
const (
	ActionCreated ActionType = "CREATED"
)

type BaseData

type BaseData struct {
	Skip                 bool       `json:"skip,omitempty"`
	SkipReason           string     `json:"skipReason,omitempty"`
	Id                   string     `json:"id,omitempty"`
	ExternalId           string     `json:"externalId,omitempty"`
	ExternalIdSecond     string     `json:"externalIdSecond,omitempty"`
	ExternalSystem       string     `json:"externalSystem,omitempty"`
	ExternalUrl          string     `json:"externalUrl,omitempty"`
	ExternalSourceEntity string     `json:"externalSourceEntity,omitempty"`
	CreatedAtStr         string     `json:"createdAt,omitempty"`
	UpdatedAtStr         string     `json:"updatedAt,omitempty"`
	CreatedAt            *time.Time `json:"createdAtTime,omitempty"`
	UpdatedAt            *time.Time `json:"updatedAtTime,omitempty"`
	SyncId               string     `json:"syncId,omitempty"`
	AppSource            string     `json:"appSource,omitempty"`
}

func (*BaseData) SetCreatedAt

func (b *BaseData) SetCreatedAt()

func (*BaseData) SetTimes

func (b *BaseData) SetTimes()

func (*BaseData) SetUpdatedAt

func (b *BaseData) SetUpdatedAt()

type BelongsTo

type BelongsTo struct {
	Issue   ReferencedIssue              `json:"issue,omitempty"`
	Session ReferencedInteractionSession `json:"session,omitempty"`
}

func (BelongsTo) Available

func (b BelongsTo) Available() bool

type ContactData

type ContactData struct {
	BaseData
	Prefix               string                   `json:"prefix,omitempty"`
	FirstName            string                   `json:"firstName,omitempty"`
	LastName             string                   `json:"LastName,omitempty"`
	Name                 string                   `json:"name,omitempty"`
	Email                string                   `json:"email,omitempty"`
	AdditionalEmails     []string                 `json:"additionalEmails,omitempty"`
	PhoneNumbers         []PhoneNumber            `json:"phoneNumbers,omitempty"`
	UserExternalId       string                   `json:"externalUserId,omitempty"`
	UserExternalIdSecond string                   `json:"externalUserIdSecond,omitempty"`
	TextCustomFields     []TextCustomField        `json:"textCustomFields,omitempty"`
	Tags                 []string                 `json:"tags,omitempty"`
	LocationName         string                   `json:"locationName,omitempty"`
	Country              string                   `json:"country,omitempty"`
	Region               string                   `json:"region,omitempty"`
	Locality             string                   `json:"locality,omitempty"`
	Street               string                   `json:"street,omitempty"`
	Address              string                   `json:"address,omitempty"`
	Zip                  string                   `json:"zip,omitempty"`
	PostalCode           string                   `json:"postalCode,omitempty"`
	Timezone             string                   `json:"timezone,omitempty"`
	ProfilePhotoUrl      string                   `json:"profilePhotoUrl,omitempty"`
	Organizations        []ReferencedOrganization `json:"organizations,omitempty"`
	OrganizationRequired bool                     `json:"organizationRequired,omitempty"`
}

type ContactNote

type ContactNote struct {
	FieldSource string `json:"fieldSource,omitempty"`
	Note        string `json:"note,omitempty"`
}

type EmailMessageData

type EmailMessageData struct {
	BaseData
	Html                string   `json:"html,omitempty"`
	Text                string   `json:"text,omitempty"`
	Subject             string   `json:"subject,omitempty"`
	ExternalContactsIds []string `json:"externalContactsIds,omitempty"`
	ExternalUserId      string   `json:"externalUserId,omitempty"`
	EmailMessageId      string   `json:"messageId,omitempty"`
	EmailThreadId       string   `json:"threadId,omitempty"`
	FromEmail           string   `json:"fromEmail,omitempty"`
	ToEmail             []string `json:"toEmail,omitempty"`
	CcEmail             []string `json:"ccEmail,omitempty"`
	BccEmail            []string `json:"bccEmail,omitempty"`
	Direction           string   `json:"direction,omitempty"`
	FromFirstName       string   `json:"firstName,omitempty"`
	FromLastName        string   `json:"lastName,omitempty"`
}

func (*EmailMessageData) Normalize

func (m *EmailMessageData) Normalize()

type InteractionEventData

type InteractionEventData struct {
	BaseData
	Content        string                        `json:"content,omitempty"`
	ContentType    string                        `json:"contentType,omitempty"`
	EventType      string                        `json:"eventType,omitempty"`
	Channel        string                        `json:"channel,omitempty"`
	Identifier     string                        `json:"identifier,omitempty"`
	Hide           bool                          `json:"hide,omitempty"`
	BelongsTo      BelongsTo                     `json:"belongsTo,omitempty"`
	SessionDetails InteractionSession            `json:"sessionDetails,omitempty"`
	SentBy         InteractionEventParticipant   `json:"sentBy,omitempty"`
	SentTo         []InteractionEventParticipant `json:"sentTo,omitempty"`
	// in sent to or sent by at least 1 contact should be available in the system
	ContactRequired bool `json:"contactRequired,omitempty"`
	// interaction session should already exist in the system
	ParentRequired bool `json:"parentRequired,omitempty"`
}

func (*InteractionEventData) HasSender

func (i *InteractionEventData) HasSender() bool

func (*InteractionEventData) HasSession

func (i *InteractionEventData) HasSession() bool

func (*InteractionEventData) IsPartOf

func (i *InteractionEventData) IsPartOf() bool

func (*InteractionEventData) Normalize

func (i *InteractionEventData) Normalize()

type InteractionEventParticipant

type InteractionEventParticipant struct {
	ReferencedUser         ReferencedUser         `json:"referencedUser,omitempty"`
	ReferencedContact      ReferencedContact      `json:"referencedContact,omitempty"`
	ReferencedOrganization ReferencedOrganization `json:"referencedOrganization,omitempty"`
	ReferencedParticipant  ReferencedParticipant  `json:"referencedParticipant,omitempty"`
	ReferencedJobRole      ReferencedJobRole      `json:"referencedJobRole,omitempty"`
	RelationType           string                 `json:"relationType,omitempty"`
}

type InteractionSession

type InteractionSession struct {
	BaseData
	Name       string `json:"name,omitempty"`
	Channel    string `json:"channel,omitempty"`
	Type       string `json:"type,omitempty"`
	Status     string `json:"status,omitempty"`
	Identifier string `json:"identifier,omitempty"`
}

type IssueData

type IssueData struct {
	BaseData
	Subject              string                  `json:"subject,omitempty"`
	Status               string                  `json:"status,omitempty"`
	Priority             string                  `json:"priority,omitempty"`
	Description          string                  `json:"description,omitempty"`
	Collaborators        []ReferencedParticipant `json:"collaborators,omitempty"`
	Followers            []ReferencedParticipant `json:"followers,omitempty"`
	Assignee             ReferencedUser          `json:"userAssignee,omitempty"`
	Reporter             ReferencedParticipant   `json:"reporter,omitempty"`
	Submitter            ReferencedParticipant   `json:"submitter,omitempty"`
	OrganizationRequired bool                    `json:"organizationRequired,omitempty"`
}

type LogEntryData

type LogEntryData struct {
	BaseData
	Content              string                 `json:"content,omitempty"`
	ContentType          string                 `json:"contentType,omitempty"`
	StartedAtStr         string                 `json:"startedAt,omitempty"`
	StartedAt            *time.Time             `json:"startedAtTime,omitempty"`
	AuthorUser           ReferencedUser         `json:"authorUser,omitempty"`
	LoggedOrganization   ReferencedOrganization `json:"loggedOrganization,omitempty"`
	LoggedEntityRequired bool                   `json:"loggedEntityRequired,omitempty"`
}

type MeetingData

type MeetingData struct {
	BaseData
	Name                  string     `json:"name,omitempty"`
	StartedAtStr          string     `json:"startedAt,omitempty"`
	EndedAtStr            string     `json:"endedAt,omitempty"`
	StartedAt             *time.Time `json:"startedAtTime,omitempty"`
	EndedAt               *time.Time `json:"endedAtTime,omitempty"`
	Agenda                string     `json:"agenda,omitempty"`
	ContentType           string     `json:"contentType,omitempty"`
	MeetingUrl            string     `json:"meetingUrl,omitempty"`
	Location              string     `json:"location,omitempty"`
	ConferenceUrl         string     `json:"conferenceUrl,omitempty"`
	ExternalContactsIds   []string   `json:"externalContactsIds,omitempty"`
	CreatorUserExternalId string     `json:"externalUserId,omitempty"`
}

func (*MeetingData) HasContacts

func (m *MeetingData) HasContacts() bool

func (*MeetingData) HasLocation

func (m *MeetingData) HasLocation() bool

func (*MeetingData) HasUserCreator

func (m *MeetingData) HasUserCreator() bool

func (*MeetingData) Normalize

func (m *MeetingData) Normalize()

func (*MeetingData) SetMeetingTimes

func (m *MeetingData) SetMeetingTimes()

type OrganizationData

type OrganizationData struct {
	BaseData
	Name         string             `json:"name,omitempty"`
	Description  string             `json:"description,omitempty"`
	Domains      []string           `json:"domains,omitempty"`
	Notes        []OrganizationNote `json:"notes,omitempty"`
	Website      string             `json:"website,omitempty"`
	Industry     string             `json:"industry,omitempty"`
	IsPublic     bool               `json:"isPublic,omitempty"`
	IsCustomer   bool               `json:"isCustomer,omitempty"`
	Employees    int64              `json:"employees,omitempty"`
	PhoneNumbers []PhoneNumber      `json:"phoneNumbers,omitempty"`
	Email        string             `json:"email,omitempty"`
	// Currently not used. Sync processes will not set automatically owner user
	OwnerUser          *ReferencedUser     `json:"ownerUser,omitempty"`
	LocationName       string              `json:"locationName,omitempty"`
	Country            string              `json:"country,omitempty"`
	Region             string              `json:"region,omitempty"`
	Locality           string              `json:"locality,omitempty"`
	Address            string              `json:"address,omitempty"`
	Address2           string              `json:"address2,omitempty"`
	Zip                string              `json:"zip,omitempty"`
	ParentOrganization *ParentOrganization `json:"parentOrganization,omitempty"`
	SubIndustry        string              `json:"subIndustry,omitempty"`
	IndustryGroup      string              `json:"industryGroup,omitempty"`
	TargetAudience     string              `json:"targetAudience,omitempty"`
	ValueProposition   string              `json:"valueProposition,omitempty"`
	Market             string              `json:"market,omitempty"`
	LastFundingRound   string              `json:"lastFundingRound,omitempty"`
	LastFundingAmount  string              `json:"lastFundingAmount,omitempty"`
	// If true, the organization will be created by domain,
	// Missing domains, or blacklisted domains will result in no organization being created
	DomainRequired bool `json:"domainRequired"`
	Whitelisted    bool `json:"whitelisted,omitempty"`
	UpdateOnly     bool `json:"updateOnly,omitempty"`
}

func (*OrganizationData) HasDomains

func (o *OrganizationData) HasDomains() bool

func (*OrganizationData) HasEmail

func (o *OrganizationData) HasEmail() bool

func (*OrganizationData) HasLocation

func (o *OrganizationData) HasLocation() bool

func (*OrganizationData) HasNotes

func (o *OrganizationData) HasNotes() bool

func (*OrganizationData) HasOwner

func (o *OrganizationData) HasOwner() bool

func (*OrganizationData) HasPhoneNumbers

func (o *OrganizationData) HasPhoneNumbers() bool

func (*OrganizationData) IsSubsidiary

func (o *OrganizationData) IsSubsidiary() bool

func (*OrganizationData) Normalize

func (o *OrganizationData) Normalize()

type OrganizationNote

type OrganizationNote struct {
	FieldSource string `json:"fieldSource"`
	Note        string `json:"note"`
}

type OrganizationRelation

type OrganizationRelation string
const (
	Subsidiary OrganizationRelation = "subsidiary"
)

type ParentOrganization

type ParentOrganization struct {
	Organization         ReferencedOrganization `json:"organization,omitempty"`
	OrganizationRelation OrganizationRelation   `json:"organizationRelation,omitempty"`
	Type                 string                 `json:"type,omitempty"`
}

type PhoneNumber

type PhoneNumber struct {
	Number  string `json:"number"`
	Primary bool   `json:"primary,omitempty"`
	Label   string `json:"label,omitempty"`
}

func GetNonEmptyPhoneNumbers

func GetNonEmptyPhoneNumbers(phoneNumbers []PhoneNumber) []PhoneNumber

func RemoveDuplicatedPhoneNumbers

func RemoveDuplicatedPhoneNumbers(numbers []PhoneNumber) []PhoneNumber

type RawDataSource

type RawDataSource string
const (
	AirbyteSourceHubspot    RawDataSource = "hubspot"
	AirbyteSourcePipedrive  RawDataSource = "pipedrive"
	AirbyteSourceIntercom   RawDataSource = "intercom"
	AirbyteSourceSalesforce RawDataSource = "salesforce"
	OpenlineSourceSlack     RawDataSource = "slack"
)

func (*RawDataSource) Scan

func (rds *RawDataSource) Scan(value interface{}) error

func (RawDataSource) Value

func (rds RawDataSource) Value() (driver.Value, error)

type ReferencedContact

type ReferencedContact struct {
	ExternalId string `json:"externalId,omitempty"`
	Id         string `json:"id,omitempty"`
}

func (*ReferencedContact) Available

func (r *ReferencedContact) Available() bool

func (*ReferencedContact) GetReferencedEntityType

func (r *ReferencedContact) GetReferencedEntityType() ReferencedEntityType

func (*ReferencedContact) ReferencedByExternalId

func (r *ReferencedContact) ReferencedByExternalId() bool

func (*ReferencedContact) ReferencedById

func (r *ReferencedContact) ReferencedById() bool

type ReferencedEntity

type ReferencedEntity interface {
	GetReferencedEntityType() ReferencedEntityType
	Available() bool
}

type ReferencedEntityType

type ReferencedEntityType string
const (
	ReferencedEntityTypeUnknown      ReferencedEntityType = "unknown"
	ReferencedEntityTypeSession      ReferencedEntityType = "session"
	ReferencedEntityTypeIssue        ReferencedEntityType = "issue"
	ReferencedEntityTypeJobRole      ReferencedEntityType = "jobRole"
	ReferencedEntityTypeUser         ReferencedEntityType = "user"
	ReferencedEntityTypeContact      ReferencedEntityType = "contact"
	ReferencedEntityTypeOrganization ReferencedEntityType = "organization"
)

type ReferencedInteractionSession

type ReferencedInteractionSession struct {
	ExternalId string `json:"externalId,omitempty"`
}

func (*ReferencedInteractionSession) Available

func (r *ReferencedInteractionSession) Available() bool

func (*ReferencedInteractionSession) GetReferencedEntityType

func (r *ReferencedInteractionSession) GetReferencedEntityType() ReferencedEntityType

func (*ReferencedInteractionSession) ReferencedByExternalId

func (r *ReferencedInteractionSession) ReferencedByExternalId() bool

type ReferencedIssue

type ReferencedIssue struct {
	ExternalId string `json:"externalId,omitempty"`
}

func (*ReferencedIssue) Available

func (r *ReferencedIssue) Available() bool

func (*ReferencedIssue) GetReferencedEntityType

func (r *ReferencedIssue) GetReferencedEntityType() ReferencedEntityType

func (*ReferencedIssue) ReferencedByExternalId

func (r *ReferencedIssue) ReferencedByExternalId() bool

type ReferencedJobRole

type ReferencedJobRole struct {
	ReferencedContact      ReferencedContact      `json:"referencedContact,omitempty"`
	ReferencedOrganization ReferencedOrganization `json:"referencedOrganization,omitempty"`
}

func (*ReferencedJobRole) Available

func (r *ReferencedJobRole) Available() bool

func (*ReferencedJobRole) GetReferencedEntityType

func (r *ReferencedJobRole) GetReferencedEntityType() ReferencedEntityType

type ReferencedOrganization

type ReferencedOrganization struct {
	ExternalId string `json:"externalId,omitempty"`
	Id         string `json:"id,omitempty"`
	Domain     string `json:"domain,omitempty"`
	JobTitle   string `json:"jobTitle,omitempty"`
}

func (*ReferencedOrganization) Available

func (r *ReferencedOrganization) Available() bool

func (*ReferencedOrganization) GetReferencedEntityType

func (r *ReferencedOrganization) GetReferencedEntityType() ReferencedEntityType

func (*ReferencedOrganization) ReferencedByDomain

func (r *ReferencedOrganization) ReferencedByDomain() bool

func (*ReferencedOrganization) ReferencedByExternalId

func (r *ReferencedOrganization) ReferencedByExternalId() bool

func (*ReferencedOrganization) ReferencedById

func (r *ReferencedOrganization) ReferencedById() bool

type ReferencedParticipant

type ReferencedParticipant struct {
	ExternalId string `json:"externalId,omitempty"`
}

func (*ReferencedParticipant) Available

func (r *ReferencedParticipant) Available() bool

func (*ReferencedParticipant) GetReferencedEntityType

func (r *ReferencedParticipant) GetReferencedEntityType() ReferencedEntityType

type ReferencedUser

type ReferencedUser struct {
	ExternalId       string `json:"externalId,omitempty"`
	ExternalIdSecond string `json:"externalIdSecond,omitempty"`
	Id               string `json:"id,omitempty"`
}

func (*ReferencedUser) Available

func (r *ReferencedUser) Available() bool

func (*ReferencedUser) GetReferencedEntityType

func (r *ReferencedUser) GetReferencedEntityType() ReferencedEntityType

func (*ReferencedUser) ReferencedByExternalId

func (r *ReferencedUser) ReferencedByExternalId() bool

func (*ReferencedUser) ReferencedByExternalOwnerId

func (r *ReferencedUser) ReferencedByExternalOwnerId() bool

func (*ReferencedUser) ReferencedById

func (r *ReferencedUser) ReferencedById() bool

type SyncRun

type SyncRun struct {
	ID                         uint      `gorm:"primarykey"`
	RunId                      string    `gorm:"run_id;not null"`
	StartAt                    time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	EndAt                      time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	TenantSyncSettingsId       uint
	TenantSyncSettings         TenantSyncSettings
	TotalCompleted             int `gorm:"column:total_synced_entities"`
	TotalFailed                int `gorm:"column:total_failed_entities"`
	TotalSkipped               int `gorm:"column:total_skipped_entities"`
	CompletedContacts          int `gorm:"column:synced_contacts"`
	FailedContacts             int `gorm:"column:failed_contacts"`
	SkippedContacts            int `gorm:"column:skipped_contacts"`
	CompletedUsers             int `gorm:"column:synced_users"`
	FailedUsers                int `gorm:"column:failed_users"`
	SkippedUsers               int `gorm:"column:skipped_users"`
	CompletedOrganizations     int `gorm:"column:synced_organizations"`
	FailedOrganizations        int `gorm:"column:failed_organizations"`
	SkippedOrganizations       int `gorm:"column:skipped_organizations"`
	CompletedEmailMessages     int `gorm:"column:synced_email_messages"`
	FailedEmailMessages        int `gorm:"column:failed_email_messages"`
	SkippedEmailMessages       int `gorm:"column:skipped_email_messages"`
	CompletedIssues            int `gorm:"column:synced_issues"`
	FailedIssues               int `gorm:"column:failed_issues"`
	SkippedIssues              int `gorm:"column:skipped_issues"`
	CompletedMeetings          int `gorm:"column:synced_meetings"`
	FailedMeetings             int `gorm:"column:failed_meetings"`
	SkippedMeetings            int `gorm:"column:skipped_meetings"`
	CompletedInteractionEvents int `gorm:"column:synced_interaction_events"`
	FailedInteractionEvents    int `gorm:"column:failed_interaction_events"`
	SkippedInteractionEvents   int `gorm:"column:skipped_interaction_events"`
	CompletedLogEntries        int `gorm:"column:synced_log_entries"`
	FailedLogEntries           int `gorm:"column:failed_log_entries"`
	SkippedLogEntries          int `gorm:"column:skipped_log_entries"`
	CompletedOrders            int `gorm:"column:synced_orders"`
	FailedOrders               int `gorm:"column:failed_orders"`
	SkippedOrders              int `gorm:"column:skipped_orders"`
}

func (*SyncRun) SumTotalCompleted

func (s *SyncRun) SumTotalCompleted()

func (*SyncRun) SumTotalFailed

func (s *SyncRun) SumTotalFailed()

func (*SyncRun) SumTotalSkipped

func (s *SyncRun) SumTotalSkipped()

func (SyncRun) TableName

func (SyncRun) TableName() string

type TenantSettings

type TenantSettings struct {
	Tenant                 string `gorm:"column:tenant_name"`
	SalesforceClientId     string `gorm:"column:salesforce_client_id"`
	SalesforceClientSecret string `gorm:"column:salesforce_client_secret"`
	SalesforceRefreshToken string `gorm:"column:salesforce_refresh_token"`
}

func (TenantSettings) TableName

func (TenantSettings) TableName() string

type TenantSyncSettings

type TenantSyncSettings struct {
	ID        uint      `gorm:"primarykey"`
	CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	Tenant    string    `gorm:"column:tenant;not null;uniqueIndex:uix_tenant_source_instance"`
	Source    string    `gorm:"type:string;column:source;not null;uniqueIndex:uix_tenant_source_instance"`
	Instance  string    `gorm:"column:instance;not null;default:'';uniqueIndex:uix_tenant_source_instance"`
	Enabled   bool      `gorm:"column:enabled;not null;default:false"`
}

func (TenantSyncSettings) TableName

func (TenantSyncSettings) TableName() string

type TenantSyncSettingsList

type TenantSyncSettingsList []TenantSyncSettings

type TextCustomField

type TextCustomField struct {
	Name           string     `json:"name,omitempty"`
	Value          string     `json:"value,omitempty"`
	ExternalSystem string     `json:"externalSystem,omitempty"`
	CreatedAtStr   string     `json:"createdAt,omitempty"`
	CreatedAt      *time.Time `json:"createdAtTime,omitempty"`
}

type UserData

type UserData struct {
	BaseData
	Name            string        `json:"name,omitempty"`
	FirstName       string        `json:"firstName,omitempty"`
	LastName        string        `json:"lastName,omitempty"`
	Email           string        `json:"email,omitempty"`
	PhoneNumbers    []PhoneNumber `json:"phoneNumbers,omitempty"`
	ProfilePhotoUrl string        `json:"profilePhotoUrl,omitempty"`
	Timezone        string        `json:"timezone,omitempty"`
	Bot             bool          `json:"bot,omitempty"`
}

Jump to

Keyboard shortcuts

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