historyRepository

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoricRepositoryObj

type HistoricRepositoryObj struct {
}

func (*HistoricRepositoryObj) AddActivity

func (h *HistoricRepositoryObj) AddActivity(db *mongo.Database, companyToken, contactToken string, activity mongoModels.Activities) error

AddActivity stores a new activity into the global "activities" collection. The document keeps references to the company and contact tokens and embeds the activity fields inline. Each company document remains under the "companies" collection.

func (HistoricRepositoryObj) GetCompanyByToken

func (h HistoricRepositoryObj) GetCompanyByToken(db *mongo.Database, token string) (*mongoModels.Company, error)

func (*HistoricRepositoryObj) GetConeccion

func (h *HistoricRepositoryObj) GetConeccion() (*mongo.Database, *mongo.Client, error)

func (HistoricRepositoryObj) GetHistory

func (h HistoricRepositoryObj) GetHistory(db *mongo.Database, companyToken, contact string) ([]mongoModels.Activities, error)

GetHistory retrieves all activities of a company from the global "activities" collection. If contact is not empty, the results are filtered by contact token as well.

func (HistoricRepositoryObj) InsertCompany

type IHistoricRepository

type IHistoricRepository interface {
	GetHistory(db *mongo.Database, companyToken, contact string) ([]mongoModels.Activities, error)
	GetConeccion() (*mongo.Database, *mongo.Client, error)
	AddActivity(db *mongo.Database, companyToken, contactToken string, activity mongoModels.Activities) error
}

func GetProvider

func GetProvider() IHistoricRepository

Jump to

Keyboard shortcuts

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