service

package
v0.0.0-...-bcf736d Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SortContractName               = "CONTRACT_NAME"
	SearchSortContractBillingCycle = "CONTRACT_BILLING_CYCLE"
	SearchSortContractEnded        = "CONTRACT_ENDED"
	SearchInvoiceDryRunDeprecated  = "DRY_RUN"
	SearchInvoicePreview           = "INVOICE_PREVIEW"
	SearchInvoiceDryRun            = "INVOICE_DRY_RUN"
	SearchSortInvoiceStatus        = "INVOICE_STATUS"
	SearchInvoiceNumberDeprecated  = "NUMBER"
	SearchInvoiceNumber            = "INVOICE_NUMBER"
	SearchInvoiceIssueDate         = "INVOICE_ISSUED_DATE"
)

Variables

This section is empty.

Functions

func ComputeNumbersDisplay

func ComputeNumbersDisplay(previousMonthCount, currentMonthCount float64) string

func ComputePercentagesDisplay

func ComputePercentagesDisplay(previous, current float64) float64

func PrintFloatValue

func PrintFloatValue(number float64, withSign bool) string

Types

type ActionItemService

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

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

func NewActionItemService

func NewActionItemService(log logger.Logger, repositories *repository.Repositories) ActionItemService

type ActionService

type ActionService interface {
	GetActionsForNodes(ctx context.Context, entityType neo4jenum.EntityType, ids []string) (*neo4jentity.ActionEntities, error)
}

func NewActionService

func NewActionService(log logger.Logger, repository *repository.Repositories) ActionService

type BankAccountService

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

func NewBankAccountService

func NewBankAccountService(log logger.Logger, repository *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) BankAccountService

type BillableService

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

func NewBillableService

func NewBillableService(log logger.Logger, repositories *repository.Repositories) BillableService

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
}

func NewBillingProfileService

func NewBillingProfileService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients) BillingProfileService

type CacheService

type CacheService interface {
	InitCache()
	GetStates() []*model.GCliItem
}

func NewCacheService

func NewCacheService(services *Services) CacheService

type CalendarService

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

func NewCalendarService

func NewCalendarService(log logger.Logger, repositories *repository.Repositories, services *Services) CalendarService

type CommentService

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

func NewCommentService

func NewCommentService(log logger.Logger, repositories *repository.Repositories) CommentService

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)
	GetFirstContactByEmail(ctx context.Context, email 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)
}

func NewContactService

func NewContactService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) ContactService

type ContractCreateData

type ContractCreateData struct {
	Input             model.ContractInput
	ExternalReference *neo4jentity.ExternalSystemEntity
	Source            neo4jentity.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) (*neo4jentity.ContractEntity, error)
	GetContractsForOrganizations(ctx context.Context, organizationIds []string) (*neo4jentity.ContractEntities, error)
	GetContractsForInvoices(ctx context.Context, invoiceIds []string) (*neo4jentity.ContractEntities, error)
	GetContractByServiceLineItem(ctx context.Context, serviceLineItemId string) (*neo4jentity.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)
}

func NewContractService

func NewContractService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) ContractService

type CountryService

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

func NewCountryService

func NewCountryService(log logger.Logger, repository *repository.Repositories) CountryService

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

func NewCustomFieldService

func NewCustomFieldService(log logger.Logger, repository *repository.Repositories) CustomFieldService

type CustomFieldTemplateService

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

TODO deprecate and remove

func NewCustomFieldTemplateService

func NewCustomFieldTemplateService(log logger.Logger, repositories *repository.Repositories) CustomFieldTemplateService

type CustomerAddJobRoleData

type CustomerAddJobRoleData struct {
	UserId        string
	JobRoleEntity *neo4jentity.JobRoleEntity
}

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

func NewDashboardService

func NewDashboardService(log logger.Logger, repositories *repository.Repositories, services *Services) DashboardService

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

func NewEmailService

func NewEmailService(log logger.Logger, repositories *repository.Repositories, services *Services, grpcClients *grpc_client.Clients) EmailService

type EnrichmentService

type EnrichmentService interface {
	CallApiFindWorkEmail(ctx context.Context, firstName, lastName, companyName, companyDomain, linkedInUrl string, enrichPhoneNumber bool) (*enrichmentmodel.FindWorkEmailResponse, error)
}

func NewEnrichmentService

func NewEnrichmentService(log logger.Logger, services *Services, cfg *config.Config) EnrichmentService

type ExternalSystemService

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

func NewExternalSystemService

func NewExternalSystemService(log logger.Logger, repositories *repository.Repositories) ExternalSystemService

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 []*model2.SortBy) (*utils.Pagination, error)
	UpdateInvoice(ctx context.Context, input model.InvoiceUpdateInput) error
}

func NewInvoiceService

func NewInvoiceService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) InvoiceService

type IssueService

type IssueService interface {
	GetIssueSummaryByStatusForOrganization(ctx context.Context, organizationId string) (map[string]int64, error)
	GetById(ctx context.Context, issueId string) (*entity.IssueEntity, error)
	GetIssuesForInteractionEvents(ctx context.Context, ids []string) (*entity.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)
	// contains filtered or unexported methods
}

func NewIssueService

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

type LocationService

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

func NewLocationService

func NewLocationService(log logger.Logger, repositories *repository.Repositories) LocationService

type LogEntryService

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

func NewLogEntryService

func NewLogEntryService(log logger.Logger, repositories *repository.Repositories) LogEntryService

type MeetingCreateData

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

type MeetingParticipant

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

func MapMeetingParticipantInputListToParticipant

func MapMeetingParticipantInputListToParticipant(input []*model.MeetingParticipantInput) []MeetingParticipant

func MapMeetingParticipantInputToParticipant

func MapMeetingParticipantInputToParticipant(participant *model.MeetingParticipantInput) MeetingParticipant

type MeetingService

type MeetingService interface {
	Update(ctx context.Context, input *MeetingUpdateData) (*entity.MeetingEntity, error)
	Create(ctx context.Context, newMeeting *MeetingCreateData) (*entity.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) (*entity.MeetingEntity, error)
	GetMeetingForInteractionEvent(ctx context.Context, interactionEventId string) (*entity.MeetingEntity, error)
	GetMeetingsForInteractionEvents(ctx context.Context, ids []string) (*entity.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)
	// contains filtered or unexported methods
}

func NewMeetingService

func NewMeetingService(log logger.Logger, repositories *repository.Repositories, services *Services) MeetingService

type MeetingUpdateData

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

type NoteService

type NoteService interface {
	GetById(ctx context.Context, id string) (*entity.NoteEntity, error)
	GetNotesForMeetings(ctx context.Context, ids []string) (*entity.NoteEntities, error)

	CreateNoteForMeeting(ctx context.Context, meetingId string, entity *entity.NoteEntity) (*entity.NoteEntity, error)

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

	NoteLinkAttachment(ctx context.Context, noteID string, attachmentID string) error
	NoteUnlinkAttachment(ctx context.Context, noteID string, attachmentID string) error
	// contains filtered or unexported methods
}

func NewNoteService

func NewNoteService(log logger.Logger, repositories *repository.Repositories, services *Services) NoteService

type OpportunityService

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

func NewOpportunityService

func NewOpportunityService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) OpportunityService

type OrganizationService

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

func NewOrganizationService

func NewOrganizationService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) OrganizationService

type OrganizationUpdateData

type OrganizationUpdateData struct {
	Organization *neo4jentity.OrganizationEntity
	Domains      []string
}

type PageViewService

type PageViewService interface {
	// contains filtered or unexported methods
}

func NewPageViewService

func NewPageViewService(log logger.Logger, repositories *repository.Repositories) PageViewService

type SearchService

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

func NewSearchService

func NewSearchService(log logger.Logger, repositories *repository.Repositories, services *Services) SearchService

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
}

func MapServiceLineItemBulkItemsToData

func MapServiceLineItemBulkItemsToData(input []*model.ServiceLineItemBulkUpdateItem) []*ServiceLineItemDetails

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

func NewServiceLineItemService

func NewServiceLineItemService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) ServiceLineItemService

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 Services

type Services struct {
	Cfg          *config.Config
	Log          logger.Logger
	Cache        CacheService // todo move this to cache
	Repositories *repository.Repositories

	CommonServices      *commonService.Services
	FileStoreApiService fsc.FileStoreApiService

	BankAccountService         BankAccountService
	ContactService             ContactService
	OrganizationService        OrganizationService
	CustomFieldService         CustomFieldService
	EmailService               EmailService
	UserService                UserService
	CustomFieldTemplateService CustomFieldTemplateService
	TimelineEventService       TimelineEventService
	NoteService                NoteService
	CalendarService            CalendarService
	LocationService            LocationService
	SearchService              SearchService
	QueryService               DashboardService
	IssueService               IssueService
	PageViewService            PageViewService
	MeetingService             MeetingService
	ExternalSystemService      ExternalSystemService
	ActionService              ActionService
	CountryService             CountryService
	ActionItemService          ActionItemService
	BillableService            BillableService
	LogEntryService            LogEntryService
	CommentService             CommentService
	ContractService            ContractService
	ServiceLineItemService     ServiceLineItemService
	OpportunityService         OpportunityService
	BillingProfileService      BillingProfileService
	InvoiceService             InvoiceService
	SlackService               SlackService
	EnrichmentService          EnrichmentService
	WebhookService             WebhookService
}

func InitServices

func InitServices(log logger.Logger, driver *neo4j.DriverWithContext, postgresDB *commonConfig.PostgresDB, cfg *config.Config, commonServices *commonService.Services, grpcClients *grpc_client.Clients) *Services

type SlackService

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

func NewSlackService

func NewSlackService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) SlackService

type SortMultipleEntitiesDefinition

type SortMultipleEntitiesDefinition struct {
	EntityPrefix   string
	EntityMapping  reflect.Type
	EntityAlias    string
	EntityDefaults []SortMultipleEntitiesDefinitionDefault
}

type SortMultipleEntitiesDefinitionDefault

type SortMultipleEntitiesDefinitionDefault struct {
	PropertyName string
	AscDefault   string
	DescDefault  string
}

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

func NewTimelineEventService

func NewTimelineEventService(log logger.Logger, repositories *repository.Repositories, services *Services) TimelineEventService

type UserService

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

func NewUserService

func NewUserService(log logger.Logger, repositories *repository.Repositories, grpcClients *grpc_client.Clients, services *Services) UserService

type WebhookService

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

func NewWebhookService

func NewWebhookService(log logger.Logger, repositories *repository.Repositories, services *Services) WebhookService

Jump to

Keyboard shortcuts

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