service

package
v0.0.0-...-19bfec4 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommonStoreService

func NewCommonStoreService() *commonStoreService

func NewCustomerOSService

func NewCustomerOSService(driver *neo4j.Driver, postgresRepositories *repository.PostgresRepositories) *customerOSService

func NewMessageService

func NewMessageService(driver *neo4j.Driver, postgresRepositories *repository.PostgresRepositories, customerOSService *customerOSService, commonStoreService *commonStoreService) *messageService

func NewWebChatMessageStoreService

func NewWebChatMessageStoreService(driver *neo4j.Driver, postgresRepositories *repository.PostgresRepositories, customerOSService *customerOSService, commonStoreService *commonStoreService) *webChatMessageStoreService

Types

type CommonStoreService

type CommonStoreService interface {
	ConvertMSTypeToEntityType(channel msProto.MessageType) entity.EventType
	ConvertEntityTypeToMSType(eventType entity.EventType) msProto.MessageType

	ConvertMSSubtypeToEntitySubtype(channel msProto.MessageSubtype) entity.EventSubtype
	ConvertEntitySubtypeToMSSubtype(eventType entity.EventSubtype) msProto.MessageSubtype

	ConvertMSSenderTypeToEntitySenderType(direction msProto.SenderType) entity.SenderType
	ConvertEntitySenderTypeToMSSenderType(direction entity.SenderType) msProto.SenderType

	ConvertEntityDirectionToMSDirection(direction entity.Direction) msProto.MessageDirection
	ConvertMSDirectionToEntityDirection(direction msProto.MessageDirection) entity.Direction

	EncodeConversationToMS(conversation Conversation) *msProto.FeedItem
	EncodeConversationEventToMS(conversationEvent entity.ConversationEvent) *msProto.Message
}

type Contact

type Contact struct {
	Id        string
	FirstName string
	LastName  string
	Email     string
}

type Conversation

type Conversation struct {
	Id        string
	StartedAt time.Time
	UpdatedAt time.Time
	Channel   string
	Status    string

	InitiatorFirstName  string
	InitiatorLastName   string
	InitiatorUsername   string
	InitiatorType       string
	LastSenderId        string
	LastSenderType      string
	LastSenderFirstName string
	LastSenderLastName  string
	LastContentPreview  string
}

type CustomerOSService

type CustomerOSService interface {
	ContactByIdExists(contactId string) (bool, error)
	ContactByPhoneExists(e164 string) (bool, error)

	GetUserByEmail(email string) (*User, error)
	GetContactById(id string) (*Contact, error)
	GetContactByEmail(email string) (*Contact, error)

	CreateContactWithEmail(tenant string, email string) (*Contact, error)
	CreateContactWithPhone(tenant string, phone string) (*Contact, error)

	ConversationByIdExists(tenant string, conversationId string) (bool, error)

	GetConversations(tenant string) ([]Conversation, error)
	GetConversationById(tenant string, conversationId string) (Conversation, error)

	GetWebChatConversationWithContactInitiator(tenant string, contactId string) (*Conversation, error)
	GetWebChatConversationWithUserInitiator(tenant string, userId string) (*Conversation, error)

	CreateConversation(tenant string, initiatorId string, initiatorFirstName string, initiatorLastName string, initiatorUsername string, initiatorType entity.SenderType, channel entity.EventType) (*Conversation, error)
	UpdateConversation(tenant string, conversationId string, participantId string, participantType entity.SenderType, lastSenderFirstName string, lastSenderLastName string, lastContentPreview string) (string, error)
}

type User

type User struct {
	Id        string
	FirstName string
	LastName  string
	Email     string
}

Jump to

Keyboard shortcuts

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