Organizations update
This commit is contained in:
@@ -20,16 +20,16 @@ func (s *organizationService) GetAllTypes() ([]entity.OrganizationType, error) {
|
||||
return s.svc.db.Organization().GetAllTypes()
|
||||
}
|
||||
|
||||
func (s *organizationService) GetByType(organizationTypeKey string) ([]entity.Organization, error) {
|
||||
return s.svc.db.Organization().GetByType(organizationTypeKey)
|
||||
func (s *organizationService) GetByType(organizationTypeKey string, user entity.User) ([]entity.Organization, error) {
|
||||
return s.svc.db.Organization().GetByType(organizationTypeKey, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) GetByName(name string, searchType string) ([]entity.Organization, error) {
|
||||
return s.svc.db.Organization().GetByName(name, searchType)
|
||||
func (s *organizationService) GetByName(name string, searchType string, user entity.User) ([]entity.Organization, error) {
|
||||
return s.svc.db.Organization().GetByName(name, searchType, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) GetByUUID(organizationUUID string) (entity.Organization, error) {
|
||||
organization, err := s.svc.db.Organization().GetByUUID(organizationUUID)
|
||||
func (s *organizationService) GetByUUID(organizationUUID string, user entity.User) (entity.Organization, error) {
|
||||
organization, err := s.svc.db.Organization().GetByUUID(organizationUUID, user)
|
||||
if err != nil {
|
||||
return organization, err
|
||||
}
|
||||
@@ -44,13 +44,13 @@ func (s *organizationService) GetByUUID(organizationUUID string) (entity.Organiz
|
||||
return organization, err
|
||||
}
|
||||
|
||||
organization.ChildOrgs, err = s.svc.db.Organization().GetChildsByID(organization.ID)
|
||||
organization.ChildOrgs, err = s.svc.db.Organization().GetChildsByID(organization.ID, user)
|
||||
if err != nil {
|
||||
return organization, err
|
||||
}
|
||||
|
||||
if organization.ParentID > 0 {
|
||||
parent, err := s.svc.db.Organization().GetByID(organization.ParentID)
|
||||
parent, err := s.svc.db.Organization().GetByID(organization.ParentID, user)
|
||||
if err != nil {
|
||||
return organization, err
|
||||
}
|
||||
@@ -88,24 +88,24 @@ func (s *organizationService) GetAddressByUUID(contactUUID string) (entity.Organ
|
||||
return s.svc.db.Organization().GetAddressByUUID(contactUUID)
|
||||
}
|
||||
|
||||
func (s *organizationService) InactivateOrganizationAddress(address entity.OrganizationAddress) error {
|
||||
return s.svc.db.Organization().InactivateOrganizationAddress(address)
|
||||
func (s *organizationService) InactivateOrganizationAddress(address entity.OrganizationAddress, user entity.User) error {
|
||||
return s.svc.db.Organization().InactivateOrganizationAddress(address, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) SetOrganizationAddress(address entity.OrganizationAddress) (entity.OrganizationAddress, error) {
|
||||
return s.svc.db.Organization().SetOrganizationAddress(address)
|
||||
func (s *organizationService) SetOrganizationAddress(address entity.OrganizationAddress, user entity.User) (entity.OrganizationAddress, error) {
|
||||
return s.svc.db.Organization().SetOrganizationAddress(address, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) InactivateOrganizationContact(contact entity.OrganizationContact) error {
|
||||
return s.svc.db.Organization().InactivateOrganizationContact(contact)
|
||||
func (s *organizationService) InactivateOrganizationContact(contact entity.OrganizationContact, user entity.User) error {
|
||||
return s.svc.db.Organization().InactivateOrganizationContact(contact, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) SetOrganizationContact(contact entity.OrganizationContact) (entity.OrganizationContact, error) {
|
||||
return s.svc.db.Organization().SetOrganizationContact(contact)
|
||||
func (s *organizationService) SetOrganizationContact(contact entity.OrganizationContact, user entity.User) (entity.OrganizationContact, error) {
|
||||
return s.svc.db.Organization().SetOrganizationContact(contact, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) AddOrganization(organization entity.Organization) (entity.Organization, error) {
|
||||
return s.svc.db.Organization().AddOrganization(organization)
|
||||
func (s *organizationService) AddOrganization(organization entity.Organization, user entity.User) (entity.Organization, error) {
|
||||
return s.svc.db.Organization().AddOrganization(organization, user)
|
||||
}
|
||||
|
||||
func (s *organizationService) GetTypeByKey(key string) (entity.OrganizationType, error) {
|
||||
|
||||
Reference in New Issue
Block a user