usecase

package
v0.0.0-...-0bdcfb2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CityUseCase

type CityUseCase struct {
	Repo repository.CityRepository
}

func NewCityUseCase

func NewCityUseCase(repo repository.CityRepository) CityUseCase

func (CityUseCase) ById

func (u CityUseCase) ById(ctx context.Context, id uint) (entity.City, error)

func (CityUseCase) CityList

func (u CityUseCase) CityList(ctx context.Context, page, size, stateId int, title string) ([]entity.City, error)

func (CityUseCase) Count

func (u CityUseCase) Count(ctx context.Context) (int, error)

func (CityUseCase) Create

func (u CityUseCase) Create(context context.Context, title string, state entity.State) (entity.City, error)

func (CityUseCase) DeleteById

func (u CityUseCase) DeleteById(ctx context.Context, id uint) error

func (CityUseCase) DoesCityExist

func (u CityUseCase) DoesCityExist(ctx context.Context, id, stateId uint) bool

func (CityUseCase) Update

func (u CityUseCase) Update(ctx context.Context, id uint, newInfo map[string]any) (entity.City, error)

type OTPUseCase

type OTPUseCase struct {
	Repo repository.OTPCodeRepository
}

func NewOTPCase

func NewOTPCase(otpRepo repository.OTPCodeRepository) OTPUseCase

func (OTPUseCase) GenerateCode

func (otp OTPUseCase) GenerateCode(ctx context.Context, mobileNumber string) (string, error)

func (OTPUseCase) ValidateCode

func (otp OTPUseCase) ValidateCode(ctx context.Context, mobileNumber string, code string) error

type StateUseCase

type StateUseCase struct {
	Repo repository.StateRepository
}

func NewStateUseCase

func NewStateUseCase(repo repository.StateRepository) StateUseCase

func (StateUseCase) Count

func (u StateUseCase) Count(ctx context.Context) (int, error)

func (StateUseCase) Create

func (u StateUseCase) Create(context context.Context, state *entity.State) error

func (StateUseCase) DeleteById

func (u StateUseCase) DeleteById(ctx context.Context, id uint) error

func (StateUseCase) DoesStateExist

func (u StateUseCase) DoesStateExist(ctx context.Context, id uint) bool

func (StateUseCase) GetStateById

func (u StateUseCase) GetStateById(ctx context.Context, id uint) (entity.State, error)

func (StateUseCase) GetStateList

func (u StateUseCase) GetStateList(ctx context.Context, page, pageSize int, title string) ([]entity.State, error)

func (StateUseCase) Update

func (u StateUseCase) Update(ctx context.Context, id uint, newInfo map[string]any) error

type UserUseCase

type UserUseCase struct {
	Repo repository.UserRepository
}

func NewUserUseCase

func NewUserUseCase(userRepo repository.UserRepository) UserUseCase

func (UserUseCase) Count

func (u UserUseCase) Count() (int, error)

func (UserUseCase) DeleteById

func (u UserUseCase) DeleteById(id uint) error

func (UserUseCase) DoesUserExist

func (u UserUseCase) DoesUserExist(id uint) bool

func (UserUseCase) GetUserById

func (u UserUseCase) GetUserById(id uint) (entity.User, error)

func (UserUseCase) GetUserOrCreate

func (u UserUseCase) GetUserOrCreate(mobileNumber string) (*entity.User, error)

func (UserUseCase) GetUsersList

func (u UserUseCase) GetUsersList(pageNumber, pageSize int, mobileNumber, fullName string) ([]entity.User, error)

func (UserUseCase) Update

func (u UserUseCase) Update(id uint, newInfo map[string]any) error

Jump to

Keyboard shortcuts

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