Documentation
¶
Index ¶
- type BaseService
- type OrganizationService
- func (e *OrganizationService) Create(filterContext *repository.OrganizationSearch, item *model.Organization) (*model.Organization, error)
- func (e *OrganizationService) CreateMany(filterContext *repository.OrganizationSearch, items []*model.Organization) ([]*model.Organization, error)
- func (e *OrganizationService) Delete(filterContext *repository.OrganizationSearch, id uuid.UUID) error
- func (e *OrganizationService) DeleteMany(filterContext *repository.OrganizationSearch, ids []uuid.UUID) error
- func (e *OrganizationService) Deleted(searchParams *repository.OrganizationSearch) ([]string, error)
- func (e *OrganizationService) FindAll(filterContext *repository.OrganizationSearch, pageSize int, page int) (response.PagedResult[*model.Organization], error)
- func (e *OrganizationService) FindById(filterContext *repository.OrganizationSearch, id uuid.UUID) (*model.Organization, error)
- func (e *OrganizationService) FindByIds(filterContext *repository.OrganizationSearch, ids []uuid.UUID) ([]*model.Organization, error)
- func (e *OrganizationService) Search(searchParams *repository.OrganizationSearch) (response.PagedResult[*model.Organization], error)
- func (e *OrganizationService) Update(filterContext *repository.OrganizationSearch, item *model.Organization) (*model.Organization, error)
- func (e *OrganizationService) UpdateMany(filterContext *repository.OrganizationSearch, items []*model.Organization) ([]*model.Organization, error)
- type SystemUserOrganizationSearch
- type SystemUserOrganizationService
- func (e *SystemUserOrganizationService) Create(filterContext *repository.SystemUserOrganizationSearch, ...) (*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationService) CreateMany(filterContext *repository.SystemUserOrganizationSearch, ...) ([]*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationService) Delete(filterContext *repository.SystemUserOrganizationSearch, id uuid.UUID) error
- func (e *SystemUserOrganizationService) DeleteMany(filterContext *repository.SystemUserOrganizationSearch, ids []uuid.UUID) error
- func (e *SystemUserOrganizationService) Deleted(searchParams *repository.SystemUserOrganizationSearch) ([]string, error)
- func (e *SystemUserOrganizationService) FindAll(filterContext *repository.SystemUserOrganizationSearch, pageSize int, page int) (response.PagedResult[*model.SystemUserOrganization], error)
- func (e *SystemUserOrganizationService) FindById(filterContext *repository.SystemUserOrganizationSearch, id uuid.UUID) (*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationService) FindByIds(filterContext *repository.SystemUserOrganizationSearch, ids []uuid.UUID) ([]*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationService) Search(searchParams *repository.SystemUserOrganizationSearch) (response.PagedResult[*model.SystemUserOrganization], error)
- func (e *SystemUserOrganizationService) Update(filterContext *repository.SystemUserOrganizationSearch, ...) (*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationService) UpdateMany(filterContext *repository.SystemUserOrganizationSearch, ...) ([]*model.SystemUserOrganization, error)
- type SystemUserService
- func (e *SystemUserService) DeleteOrgById(orgId uuid.UUID) error
- func (e *SystemUserService) DeleteOrgSystemUserById(orgId uuid.UUID, userId uuid.UUID) error
- func (e *SystemUserService) DeleteUserById(userId uuid.UUID) error
- func (e *SystemUserService) GetByUserId(userId uuid.UUID) (*model.SystemUser, error)
- func (e *SystemUserService) GetUserByUserName(userName string) (*model.SystemUser, error)
- func (e *SystemUserService) RegisterOrganization(org *model.Organization) (*model.Organization, error)
- func (e *SystemUserService) SearchUserByEmailOrMobile(email string, mobileNumber string) (*model.SystemUser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseService ¶
type BaseService[T any, K comparable, S any] interface { // Create adds a new item. // filterContext provides additional context for the operation. // item is the item to be created. // Returns the created item and an error if any. Create(filterContext *S, item *T) (*T, error) // CreateMany adds multiple new items. // filterContext provides additional context for the operation. // items is the list of items to be created. // Returns the list of created items and an error if any. CreateMany(filterContext *S, items []*T) ([]*T, error) // Update modifies an existing item. // filterContext provides additional context for the operation. // item is the item to be updated. // Returns the updated item and an error if any. Update(filterContext *S, item *T) (*T, error) // UpdateMany modifies multiple existing items. // filterContext provides additional context for the operation. // items is the list of items to be updated. // Returns the list of updated items and an error if any. UpdateMany(filterContext *S, items []*T) ([]*T, error) // Delete removes an item by its identifier. // searchParams provides the search parameters. // id is the identifier of the item to be deleted. // Returns an error if any. Delete(searchParams *S, id K) error // DeleteMany removes multiple items by their identifiers. // searchParams provides the search parameters. // ids is the list of identifiers of the items to be deleted. // Returns an error if any. DeleteMany(searchParams *S, ids []K) error // FindById retrieves an item by its identifier. // searchParams provides the search parameters. // id is the identifier of the item to be retrieved. // Returns the found item and an error if any. FindById(searchParams *S, id K) (*T, error) // FindByIds retrieves multiple items by their identifiers. // searchParams provides the search parameters. // ids is the list of identifiers of the items to be retrieved. // Returns the list of found items and an error if any. FindByIds(searchParams *S, ids []K) ([]*T, error) // FindAll retrieves all items with pagination. // searchParams provides the search parameters. // pageSize is the number of items per page. // page is the page number. // Returns a paged result of found items and an error if any. FindAll(searchParams *S, pageSize int, page int) (response.PagedResult[*T], error) // Search performs a search based on the search parameters. // searchParams provides the search parameters. // Returns a paged result of found items and an error if any. Search(searchParams *S) (response.PagedResult[*T], error) // Deleted retrieves the identifiers of deleted items. // searchParams provides the search parameters. // Returns the list of identifiers of deleted items and an error if any. Deleted(searchParams *S) ([]string, error) }
BaseService defines a generic interface for basic CRUD operations. T represents the type of the item. K represents the type of the item's identifier. S represents the type of the search parameters.
func NewOrganizationService ¶
func NewOrganizationService(repository repository.BaseRepository[model.Organization, uuid.UUID, repository.OrganizationSearch], validate *validator.Validate) BaseService[model.Organization, uuid.UUID, repository.OrganizationSearch]
type OrganizationService ¶
type OrganizationService struct {
Validate *validator.Validate
// contains filtered or unexported fields
}
func (*OrganizationService) Create ¶
func (e *OrganizationService) Create(filterContext *repository.OrganizationSearch, item *model.Organization) (*model.Organization, error)
func (*OrganizationService) CreateMany ¶
func (e *OrganizationService) CreateMany(filterContext *repository.OrganizationSearch, items []*model.Organization) ([]*model.Organization, error)
func (*OrganizationService) Delete ¶
func (e *OrganizationService) Delete(filterContext *repository.OrganizationSearch, id uuid.UUID) error
func (*OrganizationService) DeleteMany ¶
func (e *OrganizationService) DeleteMany(filterContext *repository.OrganizationSearch, ids []uuid.UUID) error
func (*OrganizationService) Deleted ¶
func (e *OrganizationService) Deleted(searchParams *repository.OrganizationSearch) ([]string, error)
func (*OrganizationService) FindAll ¶
func (e *OrganizationService) FindAll(filterContext *repository.OrganizationSearch, pageSize int, page int) (response.PagedResult[*model.Organization], error)
func (*OrganizationService) FindById ¶
func (e *OrganizationService) FindById(filterContext *repository.OrganizationSearch, id uuid.UUID) (*model.Organization, error)
func (*OrganizationService) FindByIds ¶
func (e *OrganizationService) FindByIds(filterContext *repository.OrganizationSearch, ids []uuid.UUID) ([]*model.Organization, error)
func (*OrganizationService) Search ¶
func (e *OrganizationService) Search(searchParams *repository.OrganizationSearch) (response.PagedResult[*model.Organization], error)
func (*OrganizationService) Update ¶
func (e *OrganizationService) Update(filterContext *repository.OrganizationSearch, item *model.Organization) (*model.Organization, error)
func (*OrganizationService) UpdateMany ¶
func (e *OrganizationService) UpdateMany(filterContext *repository.OrganizationSearch, items []*model.Organization) ([]*model.Organization, error)
type SystemUserOrganizationService ¶
type SystemUserOrganizationService struct {
Validate *validator.Validate
// contains filtered or unexported fields
}
func NewSystemUserOrganizationService ¶
func NewSystemUserOrganizationService(repository repository.BaseRepository[model.SystemUserOrganization, uuid.UUID, repository.SystemUserOrganizationSearch], validate *validator.Validate) *SystemUserOrganizationService
func (*SystemUserOrganizationService) Create ¶
func (e *SystemUserOrganizationService) Create(filterContext *repository.SystemUserOrganizationSearch, item *model.SystemUserOrganization) (*model.SystemUserOrganization, error)
func (*SystemUserOrganizationService) CreateMany ¶
func (e *SystemUserOrganizationService) CreateMany(filterContext *repository.SystemUserOrganizationSearch, items []*model.SystemUserOrganization) ([]*model.SystemUserOrganization, error)
func (*SystemUserOrganizationService) Delete ¶
func (e *SystemUserOrganizationService) Delete(filterContext *repository.SystemUserOrganizationSearch, id uuid.UUID) error
func (*SystemUserOrganizationService) DeleteMany ¶
func (e *SystemUserOrganizationService) DeleteMany(filterContext *repository.SystemUserOrganizationSearch, ids []uuid.UUID) error
func (*SystemUserOrganizationService) Deleted ¶
func (e *SystemUserOrganizationService) Deleted(searchParams *repository.SystemUserOrganizationSearch) ([]string, error)
func (*SystemUserOrganizationService) FindAll ¶
func (e *SystemUserOrganizationService) FindAll(filterContext *repository.SystemUserOrganizationSearch, pageSize int, page int) (response.PagedResult[*model.SystemUserOrganization], error)
func (*SystemUserOrganizationService) FindById ¶
func (e *SystemUserOrganizationService) FindById(filterContext *repository.SystemUserOrganizationSearch, id uuid.UUID) (*model.SystemUserOrganization, error)
func (*SystemUserOrganizationService) FindByIds ¶
func (e *SystemUserOrganizationService) FindByIds(filterContext *repository.SystemUserOrganizationSearch, ids []uuid.UUID) ([]*model.SystemUserOrganization, error)
func (*SystemUserOrganizationService) Search ¶
func (e *SystemUserOrganizationService) Search(searchParams *repository.SystemUserOrganizationSearch) (response.PagedResult[*model.SystemUserOrganization], error)
func (*SystemUserOrganizationService) Update ¶
func (e *SystemUserOrganizationService) Update(filterContext *repository.SystemUserOrganizationSearch, item *model.SystemUserOrganization) (*model.SystemUserOrganization, error)
func (*SystemUserOrganizationService) UpdateMany ¶
func (e *SystemUserOrganizationService) UpdateMany(filterContext *repository.SystemUserOrganizationSearch, items []*model.SystemUserOrganization) ([]*model.SystemUserOrganization, error)
type SystemUserService ¶
type SystemUserService struct {
Validate *validator.Validate
// contains filtered or unexported fields
}
func NewSystemUserService ¶
func NewSystemUserService(repository *repository.SystemUserRepo, organizationRepo repository.BaseRepository[model.Organization, uuid.UUID, repository.OrganizationSearch], systemUserOrganizationRepository repository.BaseRepository[model.SystemUserOrganization, uuid.UUID, repository.SystemUserOrganizationSearch], validate *validator.Validate) *SystemUserService
func (*SystemUserService) DeleteOrgById ¶
func (e *SystemUserService) DeleteOrgById(orgId uuid.UUID) error
func (*SystemUserService) DeleteOrgSystemUserById ¶
func (*SystemUserService) DeleteUserById ¶
func (e *SystemUserService) DeleteUserById(userId uuid.UUID) error
func (*SystemUserService) GetByUserId ¶
func (e *SystemUserService) GetByUserId(userId uuid.UUID) (*model.SystemUser, error)
func (*SystemUserService) GetUserByUserName ¶
func (e *SystemUserService) GetUserByUserName(userName string) (*model.SystemUser, error)
func (*SystemUserService) RegisterOrganization ¶
func (e *SystemUserService) RegisterOrganization(org *model.Organization) (*model.Organization, error)
RegisterOrganization creates an organization
func (*SystemUserService) SearchUserByEmailOrMobile ¶
func (e *SystemUserService) SearchUserByEmailOrMobile(email string, mobileNumber string) (*model.SystemUser, error)
SearchUserByEmailOrMobile finds a user by email of mobile
Click to show internal directories.
Click to hide internal directories.