service

package
v0.0.0-...-bfa4b6c Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDateTime

func GetDateTime(date string) (start primitive.DateTime, end primitive.DateTime)

func GetPayment

func GetPayment(payment string) (pay primitive.E)

Types

type AudienceService

type AudienceService struct {
	// contains filtered or unexported fields
}

func (*AudienceService) DeleteAllAudiences

func (s *AudienceService) DeleteAllAudiences(ctx context.Context, userID primitive.ObjectID) (err error)

func (*AudienceService) DeleteAudience

func (s *AudienceService) DeleteAudience(ctx context.Context, userID primitive.ObjectID, audID primitive.ObjectID) (err error)

func (*AudienceService) GetAllAudiences

func (s *AudienceService) GetAllAudiences(ctx context.Context, userID primitive.ObjectID) (auds []types.Audience, err error)

func (*AudienceService) GetAudienceByID

func (s *AudienceService) GetAudienceByID(ctx context.Context, userID primitive.ObjectID, audID primitive.ObjectID) (aud types.Audience, err error)

func (*AudienceService) InsertAudience

func (s *AudienceService) InsertAudience(ctx context.Context, aud types.Audience) (insertedAud types.Audience, err error)

func (*AudienceService) UpdateAudience

func (s *AudienceService) UpdateAudience(ctx context.Context, update types.Audience) (aud types.Audience, err error)

type GoodsService

type GoodsService struct {
	// contains filtered or unexported fields
}

func (*GoodsService) DeleteAllGoods

func (s *GoodsService) DeleteAllGoods(ctx context.Context, userID primitive.ObjectID) (err error)

func (*GoodsService) DeleteGood

func (s *GoodsService) DeleteGood(ctx context.Context, userID primitive.ObjectID, goodID primitive.ObjectID) (err error)

func (*GoodsService) GetAllGoods

func (s *GoodsService) GetAllGoods(ctx context.Context, userID primitive.ObjectID) (goods []types.Good, err error)

func (*GoodsService) GetGoodByID

func (s *GoodsService) GetGoodByID(ctx context.Context, userID primitive.ObjectID, goodID primitive.ObjectID) (good types.Good, err error)

func (*GoodsService) InsertGood

func (s *GoodsService) InsertGood(ctx context.Context, good types.Good) (insertedGood types.Good, err error)

func (*GoodsService) UpdateGood

func (s *GoodsService) UpdateGood(ctx context.Context, userID primitive.ObjectID, goodID primitive.ObjectID, update types.UpdateGood) (good types.Good, err error)

type ProductionService

type ProductionService struct {
	// contains filtered or unexported fields
}

func (*ProductionService) DeleteAllProductions

func (s *ProductionService) DeleteAllProductions(ctx context.Context, userID primitive.ObjectID) (err error)

func (*ProductionService) DeleteProduction

func (s *ProductionService) DeleteProduction(ctx context.Context, prodID primitive.ObjectID, userID primitive.ObjectID) (err error)

func (*ProductionService) GetAllProductions

func (s *ProductionService) GetAllProductions(ctx context.Context, userID primitive.ObjectID) (productions []types.Production, err error)

func (*ProductionService) GetProductionByID

func (s *ProductionService) GetProductionByID(ctx context.Context, prodID primitive.ObjectID, userID primitive.ObjectID) (production types.Production, err error)

func (*ProductionService) InsertProduction

func (s *ProductionService) InsertProduction(ctx context.Context, production types.Production, userID primitive.ObjectID) (insertedProduction types.Production, err error)

type ReportsService

type ReportsService struct {
	// contains filtered or unexported fields
}

func (*ReportsService) GetProductionReportPerDate

func (s *ReportsService) GetProductionReportPerDate(ctx context.Context, userID primitive.ObjectID, goodID primitive.ObjectID, fromDate primitive.DateTime, toDate primitive.DateTime) (reports []types.ProductionReport, reportsPerGood []types.ProductionReportPerChangedGood, err error)

func (*ReportsService) GetReportPerDate

func (s *ReportsService) GetReportPerDate(ctx context.Context, userID primitive.ObjectID, goodID primitive.ObjectID, fromDate primitive.DateTime, toDate primitive.DateTime) (reports []types.TransactionReport, err error)

type Service

type Service struct {
	Collections *db.Collections

	UserService        *UserService
	AudienceService    *AudienceService
	GoodsService       *GoodsService
	TransactionService *TransactionService
	ProductionService  *ProductionService
	ReportsService     *ReportsService
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx context.Context, mongo *db.Mongo, logger *slog.Logger) *Service

type TransactionService

type TransactionService struct {
	// contains filtered or unexported fields
}

func (*TransactionService) DeleteAllTransactions

func (s *TransactionService) DeleteAllTransactions(ctx context.Context, userID primitive.ObjectID, transType types.TransactionType) error

func (*TransactionService) DeleteTransaction

func (s *TransactionService) DeleteTransaction(ctx context.Context, userID primitive.ObjectID, transID primitive.ObjectID) error

func (*TransactionService) GetAllTransactions

func (s *TransactionService) GetAllTransactions(ctx context.Context, userID primitive.ObjectID) (transactions []types.Transaction, err error)

func (*TransactionService) GetAudience

func (s *TransactionService) GetAudience(audience string, userID primitive.ObjectID, typee types.TransactionType) (aud primitive.E)

func (*TransactionService) GetBoughtTransactions

func (s *TransactionService) GetBoughtTransactions(ctx context.Context, userID primitive.ObjectID) (transactions []types.Transaction, err error)

func (*TransactionService) GetGood

func (s *TransactionService) GetGood(good string, userID primitive.ObjectID) (g primitive.E)

func (*TransactionService) GetSoldTransactions

func (s *TransactionService) GetSoldTransactions(ctx context.Context, userID primitive.ObjectID) (transactions []types.Transaction, err error)

func (*TransactionService) GetTransactionByID

func (s *TransactionService) GetTransactionByID(ctx context.Context, transID primitive.ObjectID, userID primitive.ObjectID) (transaction types.Transaction, err error)

func (*TransactionService) InsertTransaction

func (s *TransactionService) InsertTransaction(ctx context.Context, trans types.Transaction) (insertedTrans types.Transaction, err error)

func (*TransactionService) UpdateTransaction

func (s *TransactionService) UpdateTransaction(ctx context.Context, userID primitive.ObjectID, transID primitive.ObjectID, trans types.Transaction) (types.Transaction, error)

type UserService

type UserService struct {
	Type types.User
	// contains filtered or unexported fields
}

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(ctx context.Context, id primitive.ObjectID) error

func (*UserService) GetUserByEmail

func (s *UserService) GetUserByEmail(ctx context.Context, email string) error

func (*UserService) GetUserByID

func (s *UserService) GetUserByID(ctx context.Context, id primitive.ObjectID) (User types.User, error error)

func (*UserService) GetUserByUsername

func (s *UserService) GetUserByUsername(ctx context.Context, username string) (User types.User, error error)

func (*UserService) InsertUser

func (s *UserService) InsertUser(ctx context.Context, name string, email string, password string) (User types.User, error error)

func (*UserService) LoginUser

func (s *UserService) LoginUser(ctx context.Context, email_username string, password string) (User types.User, error error)

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(ctx context.Context, updateUser types.User) (User types.User, error error)

Jump to

Keyboard shortcuts

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