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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCreateRequest

func ValidateCreateRequest(dirtyData *AttachmentCreateRequestIDO) error

func ValidateUpdateRequest

func ValidateUpdateRequest(dirtyData *AttachmentUpdateRequestIDO) error

Types

type AttachmentController

type AttachmentController interface {
	Create(ctx context.Context, req *AttachmentCreateRequestIDO) (*domain.Attachment, error)
	GetByID(ctx context.Context, id primitive.ObjectID) (*domain.Attachment, error)
	UpdateByID(ctx context.Context, ns *AttachmentUpdateRequestIDO) (*domain.Attachment, error)
	ListByFilter(ctx context.Context, f *domain.AttachmentListFilter) (*domain.AttachmentListResult, error)
	ListAsSelectOptionByFilter(ctx context.Context, f *domain.AttachmentListFilter) ([]*domain.AttachmentAsSelectOption, error)
	DeleteByID(ctx context.Context, id primitive.ObjectID) error
	PermanentlyDeleteByID(ctx context.Context, id primitive.ObjectID) error
	PermanentlyDeleteAllByCustomerID(ctx context.Context, customerID primitive.ObjectID) error
	PermanentlyDeleteAllByAssociateID(ctx context.Context, associateID primitive.ObjectID) error
}

AttachmentController Interface for attachment 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 attachment_s.AttachmentStorer,
	com_storer com_s.CommentStorer,
	usr_storer user_s.UserStorer,
	c_storer c_s.CustomerStorer,
	a_storer a_s.AssociateStorer,
	o_storer o_s.OrderStorer,
	s_storer s_s.StaffStorer,
) AttachmentController

type AttachmentControllerImpl

type AttachmentControllerImpl struct {
	Config           *config.Conf
	Logger           *slog.Logger
	UUID             uuid.Provider
	Kmutex           kmutex.Provider
	S3               s3_storage.S3Storager
	Emailer          mg.Emailer
	DbClient         *mongo.Client
	AttachmentStorer attachment_s.AttachmentStorer
	CommentStorer    com_s.CommentStorer
	UserStorer       user_s.UserStorer
	CustomerStorer   c_s.CustomerStorer
	AssociateStorer  a_s.AssociateStorer
	OrderStorer      o_s.OrderStorer
	StaffStorer      s_s.StaffStorer
}

func (*AttachmentControllerImpl) Create

func (*AttachmentControllerImpl) DeleteByID

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

DeleteByID function archives the attachment and creates a comment of the log.

func (*AttachmentControllerImpl) GetByID

func (*AttachmentControllerImpl) ListAsSelectOptionByFilter

func (*AttachmentControllerImpl) ListByFilter

func (*AttachmentControllerImpl) PermanentlyDeleteAllByAssociateID

func (impl *AttachmentControllerImpl) PermanentlyDeleteAllByAssociateID(ctx context.Context, associateID primitive.ObjectID) error

func (*AttachmentControllerImpl) PermanentlyDeleteAllByCustomerID

func (impl *AttachmentControllerImpl) PermanentlyDeleteAllByCustomerID(ctx context.Context, customerID primitive.ObjectID) error

func (*AttachmentControllerImpl) PermanentlyDeleteByID

func (impl *AttachmentControllerImpl) PermanentlyDeleteByID(ctx context.Context, id primitive.ObjectID) error

func (*AttachmentControllerImpl) UpdateByID

type AttachmentCreateRequestIDO

type AttachmentCreateRequestIDO struct {
	Title         string
	Description   string
	OwnershipID   primitive.ObjectID
	OwnershipWJID uint64
	OwnershipType int8
	FileName      string
	FileType      string
	File          multipart.File
}

type AttachmentUpdateRequestIDO

type AttachmentUpdateRequestIDO struct {
	ID          primitive.ObjectID
	Title       string
	Description string
	FileName    string
	FileType    string
	File        multipart.File
}

Jump to

Keyboard shortcuts

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