usecases

package
v0.0.0-...-756a3e5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrgUsecase

type OrgUsecase interface {
	Create(ctx context.Context, request dto.CreateOrgReq) (*domains.Org, error)
	GetByID(ctx context.Context, id int64) (*domains.Org, error)
	Fetch(ctx context.Context, req dto.SearchOrgsReq) ([]*domains.Org, int64, error)
	Update(ctx context.Context, id int64, request dto.UpdateOrgReq) error
	Delete(ctx context.Context, id int64) error
	Invite(ctx context.Context, id int64, request dto.InviteUsers) error
}

OrgUsecase represent the org's usecase contract

func NewOrgUsecase

func NewOrgUsecase(
	orgRepo repositories.OrgRepository,
	userOrgRepo repositories.UserOrgRepository,
	sqlxTrans *sqlTools.SqlxTransaction,
) OrgUsecase

NewOrgUsecase will create new an orgUsecase object representation of OrgUsecase interface

type UserUsecase

type UserUsecase interface {
	Create(ctx context.Context, request dto.CreateUserReq) (*domains.User, error)
	GetByID(ctx context.Context, id int64) (*domains.User, error)
	Fetch(ctx context.Context, req dto.SearchUsersReq) ([]*domains.User, int64, error)
	Update(ctx context.Context, id int64, request dto.UpdateUserReq) error
	Delete(ctx context.Context, id int64) error
	GetByCode(ctx context.Context, code string) (*domains.User, error)
	GetByEmail(ctx context.Context, email string) (*domains.User, error)
	Register(ctx context.Context, request dto.CreateUserReq) (*domains.User, error)
}

UserUsecase represent the user's usecase contract

func NewUserUsecase

func NewUserUsecase(userRepo repositories.UserRepository, orgUsecase OrgUsecase) UserUsecase

NewUserUsecase will create new an userUsecase object representation of UserUsecase interface

Jump to

Keyboard shortcuts

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