cosapi_interfaces

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionItemService

type ActionItemService interface {
	GetActionItemsForNodes(ctx context.Context, linkedWith repository.LinkedWith, ids []string) (*entity.ActionItemEntities, error)

	MapDbNodeToActionItemEntity(node dbtype.Node) *entity.ActionItemEntity
}

type BankAccountService

type BankAccountService interface {
	GetTenantBankAccounts(ctx context.Context) (*entity.BankAccountEntities, error)
	GetTenantBankAccount(ctx context.Context, id string) (*entity.BankAccountEntity, error)
}

type BillableService

type BillableService interface {
	GetBillableDetails(ctx context.Context) (*model.TenantBillableInfo, error)
}

type BillingProfileService

type BillingProfileService interface {
	CreateBillingProfile(ctx context.Context, organizationId, legalName, taxId string, createdAt *time.Time) (string, error)
	UpdateBillingProfile(ctx context.Context, organizationId, billingProfileId string, legalName, taxId *string, updatedAt *time.Time) error
	LinkEmailToBillingProfile(ctx context.Context, organizationId, billingProfileId, emailId string, primary bool) error
	UnlinkEmailFromBillingProfile(ctx context.Context, organizationId, billingProfileId, emailId string) error
	LinkLocationToBillingProfile(ctx context.Context, organizationId, billingProfileId, locationId string) error
	UnlinkLocationFromBillingProfile(ctx context.Context, organizationId, billingProfileId, locationId string) error
}

type CalendarService

type CalendarService interface {
	GetAllForUsers(ctx context.Context, userIds []string) (*entity.CalendarEntities, error)
}

type CommentService

type CommentService interface {
	GetCommentsForIssues(ctx context.Context, issueIds []string) (*entity.CommentEntities, error)
}

type ContactCreateData

type ContactCreateData struct {
	ContactEntity     *neo4jentity.ContactEntity
	EmailEntity       *neo4jentity.EmailEntity
	PhoneNumberEntity *neo4jentity.PhoneNumberEntity
	ExternalReference *neo4jentity.ExternalSystemEntity
	Source            neo4jentity.DataSource
	SocialUrl         string
	AppSource         string
}

type ContactService

type ContactService interface {
	Create(ctx context.Context, contact *ContactCreateData) (string, error)
	GetById(ctx context.Context, id string) (*neo4jentity.ContactEntity, error)
	GetFirstContactByPhoneNumber(ctx context.Context, phoneNumber string) (*neo4jentity.ContactEntity, error)
	FindAll(ctx context.Context, page, limit int, filter *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
	PermanentDelete(ctx context.Context, id string) (bool, error)
	RestoreFromArchive(ctx context.Context, contactId string) (bool, error)
	GetContactsForJobRoles(ctx context.Context, jobRoleIds []string) (*neo4jentity.ContactEntities, error)
	GetContactsForOrganization(ctx context.Context, organizationId string, page, limit int, filter *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
	Merge(ctx context.Context, primaryContactId, mergedContactId string) error
	GetContactsForEmails(ctx context.Context, emailIds []string) (*neo4jentity.ContactEntities, error)
	GetContactsForPhoneNumbers(ctx context.Context, phoneNumberIds []string) (*neo4jentity.ContactEntities, error)
	RemoveLocation(ctx context.Context, contactId string, locationId string) error
	CustomerContactCreate(ctx context.Context, entity *CustomerContactCreateData) (*model.CustomerContact, error)
	GetContactCountByOrganizations(ctx context.Context, ids []string) (map[string]int64, error)
}

type ContractCreateData

type ContractCreateData struct {
	Input             model.ContractInput
	ExternalReference *entity.ExternalSystemEntity
	Source            entity.DataSource
	AppSource         string
}

type ContractService

type ContractService interface {
	Create(ctx context.Context, contractDetails *ContractCreateData) (string, error)
	Update(ctx context.Context, input model.ContractUpdateInput) error
	SoftDeleteContract(ctx context.Context, contractId string) (bool, error)
	GetById(ctx context.Context, id string) (*entity.ContractEntity, error)
	GetContractsForOrganizations(ctx context.Context, organizationIds []string) (*entity.ContractEntities, error)
	GetContractsForInvoices(ctx context.Context, invoiceIds []string) (*entity.ContractEntities, error)
	GetContractByServiceLineItem(ctx context.Context, serviceLineItemId string) (*entity.ContractEntity, error)
	ContractsExistForTenant(ctx context.Context) (bool, error)
	CountContracts(ctx context.Context, tenant string) (int64, error)
	RenewContract(ctx context.Context, contractId string, renewalDate *time.Time) error
	GetPaginatedContracts(ctx context.Context, page int, limit int) (*utils.Pagination, error)
}

type CountryService

type CountryService interface {
	GetCountriesForPhoneNumbers(ctx context.Context, ids []string) (*entity.CountryEntities, error)
}

type CustomFieldService

type CustomFieldService interface {
	MergeAndUpdateCustomFieldsForContact(ctx context.Context, contactId string, customFields *entity.CustomFieldEntities) error
	MergeCustomFieldToContact(ctx context.Context, contactId string, entity *entity.CustomFieldEntity) (*entity.CustomFieldEntity, error)
	UpdateCustomFieldForContact(ctx context.Context, contactId string, entity *entity.CustomFieldEntity) (*entity.CustomFieldEntity, error)
	DeleteByNameFromContact(ctx context.Context, contactId, fieldName string) (bool, error)
	DeleteByIdFromContact(ctx context.Context, contactId, fieldId string) (bool, error)
	GetCustomFields(ctx context.Context, obj *model.CustomFieldEntityType) (*entity.CustomFieldEntities, error)
}

TODO deprecate and remove

type CustomFieldTemplateService

type CustomFieldTemplateService interface {
	FindLinkedWithCustomField(ctx context.Context, customFieldId string) (*neo4jentity.CustomFieldTemplateEntity, error)
}

TODO deprecate and remove

type CustomerContactCreateData

type CustomerContactCreateData struct {
	ContactEntity *neo4jentity.ContactEntity
	EmailEntity   *neo4jentity.EmailEntity
}

type DashboardService

type DashboardService interface {
	GetDashboardViewOrganizationsData(ctx context.Context, requestDetails DashboardViewOrganizationsRequest) (*utils.Pagination, error)
	GetDashboardViewRenewalsData(ctx context.Context, requestDetails DashboardViewRenewalsRequest) (*utils.Pagination, error)

	GetDashboardCustomerMapData(ctx context.Context) ([]*entityDashboard.DashboardCustomerMapData, error)
	GetDashboardMRRPerCustomerData(ctx context.Context, start, end time.Time) (*entityDashboard.DashboardDashboardMRRPerCustomerData, error)
	GetDashboardGrossRevenueRetentionData(ctx context.Context, start, end time.Time) (*entityDashboard.DashboardGrossRevenueRetentionData, error)
	GetDashboardARRBreakdownData(ctx context.Context, start, end time.Time) (*entityDashboard.DashboardARRBreakdownData, error)
	GetDashboardRevenueAtRiskData(ctx context.Context, start, end time.Time) (*entityDashboard.DashboardRevenueAtRiskData, error)
	GetDashboardRetentionRateData(ctx context.Context, start, end time.Time) (*entityDashboard.DashboardRetentionRateData, error)
	GetDashboardNewCustomersData(ctx context.Context, start, end time.Time) (*entityDashboard.DashboardNewCustomersData, error)
	GetDashboardAverageTimeToOnboardPerMonth(ctx context.Context, start, end time.Time) (*model.DashboardTimeToOnboard, error)
	GetDashboardOnboardingCompletionPerMonth(ctx context.Context, start, end time.Time) (*model.DashboardOnboardingCompletion, error)
}

type DashboardViewOrganizationsRequest

type DashboardViewOrganizationsRequest struct {
	Where *model.Filter
	Sort  *commonModel.SortBy
	Page  int
	Limit int
}

type DashboardViewRenewalsRequest

type DashboardViewRenewalsRequest struct {
	Where *model.Filter
	Sort  *commonModel.SortBy
	Page  int
	Limit int
}

type EmailService

type EmailService interface {
	GetAllFor(ctx context.Context, entityType commonModel.EntityType, entityId string) (*neo4jentity.EmailEntities, error)
	GetAllForEntityTypeByIds(ctx context.Context, entityType commonModel.EntityType, entityIds []string) (*neo4jentity.EmailEntities, error)
	GetById(ctx context.Context, emailId string) (*neo4jentity.EmailEntity, error)
	GetByEmailAddress(ctx context.Context, email string) (*neo4jentity.EmailEntity, error)
}

type ExternalSystemService

type ExternalSystemService interface {
	GetAllExternalSystemInstances(ctx context.Context) (*entity.ExternalSystemEntities, error)
}

type InvoiceService

type InvoiceService interface {
	CountInvoices(ctx context.Context, tenant, organizationId string, where *model.Filter) (int64, error)
	GetInvoices(ctx context.Context, organizationId string, page, limit int, where *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
	UpdateInvoice(ctx context.Context, input model.InvoiceUpdateInput) error
}

type IssueService

type IssueService interface {
	GetIssueSummaryByStatusForOrganization(ctx context.Context, organizationId string) (map[string]int64, error)
	GetById(ctx context.Context, issueId string) (*neo4jentity.IssueEntity, error)
	GetIssuesForInteractionEvents(ctx context.Context, ids []string) (*neo4jentity.IssueEntities, error)
	GetSubmitterParticipantsForIssues(ctx context.Context, ids []string) (*neo4jentity.IssueParticipants, error)
	GetReporterParticipantsForIssues(ctx context.Context, ids []string) (*neo4jentity.IssueParticipants, error)
	GetAssigneeParticipantsForIssues(ctx context.Context, ids []string) (*neo4jentity.IssueParticipants, error)
	GetFollowerParticipantsForIssues(ctx context.Context, ids []string) (*neo4jentity.IssueParticipants, error)
}

type LocationService

type LocationService interface {
	CreateLocationForEntity(ctx context.Context, entityType commonModel.EntityType, entityId string, source cosapiEntity.SourceFields) (*entity.LocationEntity, error)
	Update(ctx context.Context, entity entity.LocationEntity) (*entity.LocationEntity, error)
	DetachFromEntity(ctx context.Context, entityType commonModel.EntityType, entityId, locationId string) error
}

type LogEntryService

type LogEntryService interface {
	GetById(ctx context.Context, logEntryId string) (*entity.LogEntryEntity, error)
}

type MeetingCreateData

type MeetingCreateData struct {
	MeetingEntity     *neo4jentity.MeetingEntity
	CreatedBy         []MeetingParticipant
	AttendedBy        []MeetingParticipant
	NoteInput         *model.NoteInput
	ExternalReference *neo4jentity.ExternalSystemEntity
}

type MeetingParticipant

type MeetingParticipant struct {
	ContactId      *string
	UserId         *string
	OrganizationId *string
}

type MeetingService

type MeetingService interface {
	Update(ctx context.Context, input *MeetingUpdateData) (*neo4jentity.MeetingEntity, error)
	Create(ctx context.Context, newMeeting *MeetingCreateData) (*neo4jentity.MeetingEntity, error)

	LinkAttendedBy(ctx context.Context, meetingID string, participant MeetingParticipant) error
	UnlinkAttendedBy(ctx context.Context, meetingID string, participant MeetingParticipant) error

	GetMeetingById(ctx context.Context, meetingId string) (*neo4jentity.MeetingEntity, error)
	GetMeetingForInteractionEvent(ctx context.Context, interactionEventId string) (*neo4jentity.MeetingEntity, error)
	GetMeetingsForInteractionEvents(ctx context.Context, ids []string) (*neo4jentity.MeetingEntities, error)
	GetParticipantsForMeetings(ctx context.Context, ids []string, relation entity.MeetingRelation) (*neo4jentity.MeetingParticipants, error)

	FindAll(ctx context.Context, externalSystemID string, externalID *string, page, limit int, filter *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
}

type MeetingUpdateData

type MeetingUpdateData struct {
	MeetingEntity     *neo4jentity.MeetingEntity
	NoteEntity        *entity.NoteEntity
	Meeting           *string
	ExternalReference *neo4jentity.ExternalSystemEntity
}

type NoteService

type NoteService interface {
	GetById(ctx context.Context, id string) (*entity.NoteEntity, error)
	NoteLinkAttachment(ctx context.Context, noteID string, attachmentID string) error
	NoteUnlinkAttachment(ctx context.Context, noteID string, attachmentID string) error

	CreateNoteForMeeting(ctx context.Context, meetingId string, entity *entity.NoteEntity) (*entity.NoteEntity, error)
	GetNotesForMeetings(ctx context.Context, ids []string) (*entity.NoteEntities, error)

	UpdateNote(ctx context.Context, entity *entity.NoteEntity) (*entity.NoteEntity, error)
	DeleteNote(ctx context.Context, noteId string) (bool, error)
}

type OAuthUserSettingsResponse

type OAuthUserSettingsResponse struct {
	Provider           string `json:"provider"`
	Email              string `json:"email"`
	NeedsManualRefresh bool   `json:"needsManualRefresh"`
	Type               string `json:"type"`
}

type OAuthUserSettingsService

type OAuthUserSettingsService interface {
	GetTenantOAuthUserSettings(ctx context.Context, tenant string) ([]*OAuthUserSettingsResponse, error)
}

type OpportunityService

type OpportunityService interface {
	UpdateRenewal(ctx context.Context, opportunityId string, renewalLikelihood enum.RenewalLikelihood, amount *float64, comments *string, ownerUserId *string, adjustedRate *int64, appSource string) error
	UpdateRenewalsForOrganization(ctx context.Context, organizationId string, renewalLikelihood enum.RenewalLikelihood, renewalAdjustedRate *int64) error
}

type OrganizationService

type OrganizationService interface {
	CountOrganizations(ctx context.Context, tenant string) (int64, error)
	ExistsById(ctx context.Context, organizationId string) (bool, error)
	GetByCustomerOsId(ctx context.Context, customerOsId string) (*neo4jentity.OrganizationEntity, error)
	GetByReferenceId(ctx context.Context, referenceId string) (*neo4jentity.OrganizationEntity, error)
	GetSubsidiariesForOrganizations(ctx context.Context, parentOrganizationIds []string) (*neo4jentity.OrganizationEntities, error)
	AddSubsidiary(ctx context.Context, parentOrganizationId, subsidiaryOrganizationId, subsidiaryType string, removeExisting bool) error
	RemoveSubsidiary(ctx context.Context, parentOrganizationId, subsidiaryOrganizationId string) error
	GetSubsidiariesOfForOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.OrganizationEntities, error)
	ReplaceOwner(ctx context.Context, organizationId, userId string) (*neo4jentity.OrganizationEntity, error)
	UpdateLastTouchpoint(ctx context.Context, organizationId string)
	GetOrganizationsForInvoices(ctx context.Context, invoiceIds []string) (*neo4jentity.OrganizationEntities, error)
	GetOrganizationsForSlackChannels(ctx context.Context, slackChannelIds []string) (*neo4jentity.OrganizationEntities, error)
	GetOrganizationsForJobRoles(ctx context.Context, jobRoleIds []string) (*neo4jentity.OrganizationEntities, error)
	GetOrganizationsForPhoneNumbers(ctx context.Context, phoneNumberIds []string) (*neo4jentity.OrganizationEntities, error)
	GetOrganizationsForOpportunities(ctx context.Context, opportunityIds []string) (*neo4jentity.OrganizationEntities, error)
	GetOrganizationsForEmails(ctx context.Context, emailIds []string) (*neo4jentity.OrganizationEntities, error)
	UpdateLastTouchpointByContactId(ctx context.Context, contactId string)
	GetMinMaxRenewalForecastArr(ctx context.Context) (float64, float64, error)
	GetOrganizationsForContact(ctx context.Context, contactId string, page, limit int, filter *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
	RemoveOwner(ctx context.Context, organizationId string) (*neo4jentity.OrganizationEntity, error)
	FindAll(ctx context.Context, page, limit int, filter *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
	Merge(ctx context.Context, primaryOrganizationId, mergedOrganizationId string) error
	GetOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.OrganizationEntities, error)
	GetSuggestedMergeToForOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.OrganizationEntities, error)
}

type PersonalIntegrationsService

type PersonalIntegrationsService interface {
	GetPersonalIntegration(tenantName, email, integration string) (*entity.PersonalIntegration, error)
	SavePersonalIntegration(entity.PersonalIntegration) (*entity.PersonalIntegration, error)
	GetPersonalIntegrations(tenantName, email string) ([]*entity.PersonalIntegration, error)
}

type SearchService

type SearchService interface {
	GCliSearch(ctx context.Context, keyword string, limit *int) (*entity.SearchResultEntities, error)
}

type ServiceLineItemCreateData

type ServiceLineItemCreateData struct {
	ContractId        string                            `json:"contractId"`
	SliName           string                            `json:"sliName"`
	SliPrice          float64                           `json:"sliPrice"`
	SliQuantity       int64                             `json:"sliQuantity"`
	SliBilledType     neo4jenum.BilledType              `json:"sliBilledType"`
	ExternalReference *neo4jentity.ExternalSystemEntity `json:"externalReference"`
	Source            neo4jentity.DataSource            `json:"source"`
	AppSource         string                            `json:"appSource"`
	StartedAt         *time.Time                        `json:"startedAt"`
	EndedAt           *time.Time                        `json:"endedAt"`
	SliVatRate        float64                           `json:"sliVatRate"`
}

type ServiceLineItemDetails

type ServiceLineItemDetails struct {
	Id                      string
	Name                    string
	Price                   float64
	Quantity                int64
	Billed                  neo4jenum.BilledType
	Comments                string
	IsRetroactiveCorrection bool
	VatRate                 float64
	StartedAt               *time.Time
	CloseVersion            bool
	NewVersion              bool
}

type ServiceLineItemNewVersionData

type ServiceLineItemNewVersionData struct {
	Id        string                 `json:"id"`
	Name      string                 `json:"sliName"`
	Price     float64                `json:"sliPrice"`
	Quantity  int64                  `json:"sliQuantity"`
	Comments  string                 `json:"sliComments"`
	Source    neo4jentity.DataSource `json:"source"`
	AppSource string                 `json:"appSource"`
	VatRate   float64                `json:"sliVatRate"`
	StartedAt *time.Time             `json:"startedAt"`
}

type ServiceLineItemService

type ServiceLineItemService interface {
	Create(ctx context.Context, serviceLineItemDetails ServiceLineItemCreateData) (string, error)
	Update(ctx context.Context, serviceLineItemDetails ServiceLineItemUpdateData) error
	Delete(ctx context.Context, serviceLineItemId string) (bool, error)
	Close(ctx context.Context, serviceLineItemId string, endedAt *time.Time) error
	CreateOrUpdateOrCloseInBulk(ctx context.Context, contractId string, sliBulkData []*ServiceLineItemDetails) ([]string, error)
	NewVersion(ctx context.Context, data ServiceLineItemNewVersionData) (string, error)
}

type ServiceLineItemUpdateData

type ServiceLineItemUpdateData struct {
	Id                      string                 `json:"id"`
	IsRetroactiveCorrection bool                   `json:"isRetroactiveCorrection"`
	SliName                 string                 `json:"sliName"`
	SliPrice                float64                `json:"sliPrice"`
	SliQuantity             int64                  `json:"sliQuantity"`
	SliBilledType           neo4jenum.BilledType   `json:"sliBilledType"`
	SliComments             string                 `json:"sliComments"`
	Source                  neo4jentity.DataSource `json:"source"`
	AppSource               string                 `json:"appSource"`
	SliVatRate              float64                `json:"sliVatRate"`
	StartedAt               *time.Time             `json:"startedAt"`
}

type SlackService

type SlackService interface {
	GetPaginatedSlackChannels(ctx context.Context, tenant string, page, limit int) (*utils.Pagination, error)
	GetSlackSettings(ctx context.Context, tenant string) (*SlackSettingsResponse, error)
}

type SlackSettingsResponse

type SlackSettingsResponse struct {
	SlackEnabled bool `json:"slackEnabled"`
}

type TenantSettingsService

type TenantSettingsService interface {
	GetForTenant(tenantName string) (*entity.TenantSettings, map[string]bool, error)
	SaveIntegrationData(tenantName string, request map[string]interface{}) (*entity.TenantSettings, map[string]bool, error)
	ClearIntegrationData(tenantName, identifier string) (*entity.TenantSettings, map[string]bool, error)
}

type TimelineEventService

type TimelineEventService interface {
	GetTimelineEventsForContact(ctx context.Context, contactId string, from *time.Time, size int, types []model.TimelineEventType) (*entity.TimelineEventEntities, error)
	GetTimelineEventsTotalCountForContact(ctx context.Context, contactId string, types []model.TimelineEventType) (int64, error)
	GetTimelineEventsForOrganization(ctx context.Context, organizationId string, from *time.Time, size int, types []model.TimelineEventType) (*entity.TimelineEventEntities, error)
	GetTimelineEventsTotalCountForOrganization(ctx context.Context, organizationId string, types []model.TimelineEventType) (int64, error)
	GetTimelineEventsWithIds(ctx context.Context, ids []string) (*entity.TimelineEventEntities, error)
	GetInboundCommsCountCountByOrganizations(ctx context.Context, organizationIds []string) (map[string]int64, error)
	GetOutboundCommsCountCountByOrganizations(ctx context.Context, organizationIds []string) (map[string]int64, error)
}

type UserService

type UserService interface {
	GetAll(ctx context.Context, page, limit int, filter *model.Filter, sortBy []*commonModel.SortBy) (*utils.Pagination, error)
	ContainsRole(parentCtx context.Context, allowedRoles []model.Role) bool
}

type WebhookService

type WebhookService interface {
	GetIntegration(s string) (enum.Source, error)
	CreateIntegrationWebhook(ctx context.Context, tenant string, integration enum.Source) (webhookUrl string, secret string, err error)
	ValidateTenantId(ctx context.Context, tenant, tenantId string) (bool, error)
	GetIntegrationFromWebhookPath(ctx context.Context, tenant, webhookPath string) (enum.Source, error)
	DeactivateWebhook(ctx context.Context, webhookPath string) error
}

Jump to

Keyboard shortcuts

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