Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [1.72.0] - 2025-09-15
### Added
- Change participant age field for participant filtering in research groups feature [#604](https://github.com/rokwire/groups-building-block/issues/604)

## [1.71.0] - 2025-08-21
### Fixed
- Not able to add a new staff members NetID to be an admin of a group [#606](https://github.com/rokwire/groups-building-block/issues/606)


## [1.70.1] - 2025-07-21
### Fixed
- Fix nil pointer error [#598](https://github.com/rokwire/groups-building-block/issues/598)
Expand Down
2 changes: 1 addition & 1 deletion core/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type Services interface {

// Group Notifications
SendGroupNotification(clientID string, notification model.GroupNotification, predicate model.MutePreferencePredicate) error
GetResearchProfileUserCount(clientID string, current *model.User, researchProfile map[string]map[string][]string) (int64, error)
GetResearchProfileUserCount(clientID string, current *model.User, researchProfile map[string]map[string]any) (int64, error)

// Group Events
FindAdminGroupsForEvent(clientID string, current *model.User, eventID string) ([]string, error)
Expand Down
2 changes: 1 addition & 1 deletion core/interfaces_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (s *servicesImpl) SendGroupNotification(clientID string, notification model
return s.app.sendGroupNotification(clientID, notification, predicate)
}

func (s *servicesImpl) GetResearchProfileUserCount(clientID string, current *model.User, researchProfile map[string]map[string][]string) (int64, error) {
func (s *servicesImpl) GetResearchProfileUserCount(clientID string, current *model.User, researchProfile map[string]map[string]any) (int64, error) {
return s.app.getResearchProfileUserCount(clientID, current, researchProfile)
}

Expand Down
12 changes: 6 additions & 6 deletions core/model/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ type Group struct {
BlockNewMembershipRequests bool `json:"block_new_membership_requests" bson:"block_new_membership_requests"`
AttendanceGroup bool `json:"attendance_group" bson:"attendance_group"`

ResearchOpen bool `json:"research_open" bson:"research_open"`
ResearchGroup bool `json:"research_group" bson:"research_group"`
ResearchConsentStatement string `json:"research_consent_statement" bson:"research_consent_statement"`
ResearchConsentDetails string `json:"research_consent_details" bson:"research_consent_details"`
ResearchDescription string `json:"research_description" bson:"research_description"`
ResearchProfile map[string]map[string][]string `json:"research_profile" bson:"research_profile"`
ResearchOpen bool `json:"research_open" bson:"research_open"`
ResearchGroup bool `json:"research_group" bson:"research_group"`
ResearchConsentStatement string `json:"research_consent_statement" bson:"research_consent_statement"`
ResearchConsentDetails string `json:"research_consent_details" bson:"research_consent_details"`
ResearchDescription string `json:"research_description" bson:"research_description"`
ResearchProfile map[string]map[string]any `json:"research_profile" bson:"research_profile"`

SyncStartTime *time.Time `json:"sync_start_time" bson:"sync_start_time"`
SyncEndTime *time.Time `json:"sync_end_time" bson:"sync_end_time"`
Expand Down
4 changes: 2 additions & 2 deletions core/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,12 @@ func (app *Application) findGroupMembership(clientID string, groupID string, use
return app.storage.FindGroupMembership(clientID, groupID, userID)
}

func (app *Application) getResearchProfileUserCount(clientID string, current *model.User, researchProfile map[string]map[string][]string) (int64, error) {
func (app *Application) getResearchProfileUserCount(clientID string, current *model.User, researchProfile map[string]map[string]any) (int64, error) {
searchParams := app.formatCoreAccountSearchParams(researchProfile)
return app.corebb.GetAccountsCount(searchParams, &current.AppID, &current.OrgID)
}

func (app *Application) formatCoreAccountSearchParams(researchProfile map[string]map[string][]string) map[string]interface{} {
func (app *Application) formatCoreAccountSearchParams(researchProfile map[string]map[string]any) map[string]interface{} {
searchParams := map[string]interface{}{}
for k1, v1 := range researchProfile {
for k2, v2 := range v1 {
Expand Down
2 changes: 1 addition & 1 deletion driver/web/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (we *Adapter) Start() {
restSubrouter.HandleFunc("/group/{groupID}/posts/{postID}/report/abuse", we.idTokenAuthWrapFunc(we.apisHandler.ReportAbuseGroupPost)).Methods("PUT")
restSubrouter.HandleFunc("/group/{groupID}/posts/{postID}", we.idTokenAuthWrapFunc(we.apisHandler.DeleteGroupPost)).Methods("DELETE")

restSubrouter.HandleFunc("/research-profile/user-count", we.adminIDTokenAuthWrapFunc(we.apisHandler.GetResearchProfileUserCount)).Methods("POST")
restSubrouter.HandleFunc("/research-profile/user-count", we.idTokenAuthWrapFunc(we.apisHandler.GetResearchProfileUserCount)).Methods("POST")

//mixed protection
restSubrouter.HandleFunc("/groups", we.mixedAuthWrapFunc(we.apisHandler.GetGroups)).Methods("GET")
Expand Down
2 changes: 1 addition & 1 deletion driver/web/rest/admin_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ type adminCreateGroupRequest struct {
ResearchConsentStatement string `json:"research_consent_statement"`
ResearchConsentDetails string `json:"research_consent_details"`
ResearchDescription string `json:"research_description"`
ResearchProfile map[string]map[string][]string `json:"research_profile"`
ResearchProfile map[string]map[string]any `json:"research_profile"`
Settings *model.GroupSettings `json:"settings"`
Attributes map[string]interface{} `json:"attributes"`
MembersConfig *model.DefaultMembershipConfig `json:"members,omitempty"`
Expand Down
Loading