usecases

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject(container *dig.Container) error

Inject api handlers

Types

type OrgUsecase

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

OrgUsecase represent the org's usecase contract

func NewOrgUsecase

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

NewOrgUsecase will create new an orgUsecase object representation of OrgUsecase interface

type UserUsecase

type UserUsecase interface {
	Create(ctx context.Context, request requests.CreateUserReq) (*domains.User, error)
	GetByID(ctx context.Context, id int64) (*domains.User, error)
	Fetch(ctx context.Context, req requests.SearchUsersReq) ([]*domains.User, int64, error)
	Update(ctx context.Context, id int64, request requests.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)
}

UserUsecase represent the user's usecase contract

func NewUserUsecase

func NewUserUsecase(userRepo postgres.UserRepository) 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