controller

package
v0.0.0-...-53e80a7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TenantController

type TenantController interface {
	Create(ctx context.Context, m *domain.Tenant) (*domain.Tenant, error)
	GetByID(ctx context.Context, id primitive.ObjectID) (*domain.Tenant, error)
	UpdateByID(ctx context.Context, m *domain.Tenant) (*domain.Tenant, error)
	ListByFilter(ctx context.Context, f *domain.TenantListFilter) (*domain.TenantListResult, error)
	ListAsSelectOptionByFilter(ctx context.Context, f *domain.TenantListFilter) ([]*domain.TenantAsSelectOption, error)
	DeleteByID(ctx context.Context, id primitive.ObjectID) error
	CreateComment(ctx context.Context, customerID primitive.ObjectID, content string) (*org_d.Tenant, error)
	UpdateTaxRateOperation(ctx context.Context, requestData *UpdateTaxRateOperationRequestIDO) (*org_d.Tenant, error)
}

TenantController Interface for Tenant business logic controller.

func NewController

func NewController(
	appCfg *config.Conf,
	loggerp *slog.Logger,
	uuidp uuid.Provider,
	kmux kmutex.Provider,
	s3 s3_storage.S3Storager,
	emailer mg.Emailer,
	client *mongo.Client,
	org_storer tenant_s.TenantStorer,
	usr_storer user_s.UserStorer,
) TenantController

type TenantControllerImpl

type TenantControllerImpl struct {
	Config       *config.Conf
	Logger       *slog.Logger
	UUID         uuid.Provider
	Kmutex       kmutex.Provider
	S3           s3_storage.S3Storager
	Emailer      mg.Emailer
	DbClient     *mongo.Client
	TenantStorer tenant_s.TenantStorer
	UserStorer   user_s.UserStorer
}

func (*TenantControllerImpl) Create

func (c *TenantControllerImpl) Create(ctx context.Context, m *s_d.Tenant) (*s_d.Tenant, error)

func (*TenantControllerImpl) CreateComment

func (c *TenantControllerImpl) CreateComment(ctx context.Context, TenantID primitive.ObjectID, content string) (*org_d.Tenant, error)

func (*TenantControllerImpl) DeleteByID

func (impl *TenantControllerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error

func (*TenantControllerImpl) GetByID

func (*TenantControllerImpl) ListAsSelectOptionByFilter

func (c *TenantControllerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *domain.TenantListFilter) ([]*domain.TenantAsSelectOption, error)

func (*TenantControllerImpl) ListByFilter

func (*TenantControllerImpl) UpdateByID

func (c *TenantControllerImpl) UpdateByID(ctx context.Context, ns *domain.Tenant) (*domain.Tenant, error)

func (*TenantControllerImpl) UpdateTaxRateOperation

func (impl *TenantControllerImpl) UpdateTaxRateOperation(ctx context.Context, requestData *UpdateTaxRateOperationRequestIDO) (*org_d.Tenant, error)

type UpdateTaxRateOperationRequestIDO

type UpdateTaxRateOperationRequestIDO struct {
	TenantID primitive.ObjectID `bson:"tenant_id" json:"tenant_id"`
	TaxRate  float64            `bson:"tax_rate" json:"tax_rate"`
}

Jump to

Keyboard shortcuts

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