usecase

package
v0.0.0-...-be3f9aa Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRepoNotSet = errors.New("use case repo is required")
	ErrRepo       = errors.New("error from repository")
)
View Source
var AllProperties = PropertyFilter{}

Functions

This section is empty.

Types

type PropertyFilter

type PropertyFilter struct {
	Search string
}

PropertyReader allows queries regarding properties

func NewPropertyFilter

func NewPropertyFilter() PropertyFilter

func (PropertyFilter) WithSearch

func (f PropertyFilter) WithSearch(s string) PropertyFilter

type PropertyManager

type PropertyManager struct {
	// contains filtered or unexported fields
}

PropertyReader allows queries regarding properties

func NewPropertyManager

func NewPropertyManager(repo PropertyRepo) PropertyManager

func (PropertyManager) Get

func (PropertyManager) List

func (PropertyManager) Remove

func (uc PropertyManager) Remove(ctx context.Context, id string) error

func (PropertyManager) Search

func (uc PropertyManager) Search(ctx context.Context, substr string) ([]entity.Property, error)

func (PropertyManager) Store

func (PropertyManager) Validate

func (uc PropertyManager) Validate() error

type PropertyReader

type PropertyReader interface {
	GetProperty(ctx context.Context, id string) (entity.Property, error)
	PropertyList(ctx context.Context, filter PropertyFilter) ([]entity.Property, error)
}

PropertyReader allows queries regarding properties

type PropertyRepo

type PropertyRepo interface {
	PropertyReader
	PropertyWriter
}

PropertyReader allows queries regarding properties

type PropertyWriter

type PropertyWriter interface {
	NewProperty(street, city, state, zip string) entity.Property
	StoreProperty(context.Context, entity.Property) error
	DeleteProperty(ctx context.Context, id string) error
}

PropertyReader allows queries regarding properties

type TenantManager

type TenantManager struct {
	// contains filtered or unexported fields
}

func NewTenantManager

func NewTenantManager(repo TenantRepo) TenantManager

func (TenantManager) Get

func (uc TenantManager) Get(ctx context.Context, id entity.ID) (*entity.Tenant, error)

func (TenantManager) List

func (uc TenantManager) List(ctx context.Context, filter ...filters.TenantFilter) ([]entity.Tenant, error)

func (TenantManager) Store

func (uc TenantManager) Store(ctx context.Context, tenant entity.Tenant) (*entity.Tenant, error)

func (TenantManager) Validate

func (uc TenantManager) Validate() error

type TenantRepo

type TenantRepo interface {
	StoreTenant(context.Context, entity.Tenant) error
	GetTenant(context.Context, entity.ID) (*entity.Tenant, error)
	ListTenants(context.Context, ...filters.TenantFilter) ([]entity.Tenant, error)
}

Jump to

Keyboard shortcuts

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