Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 feat: update club models #911

Merged
merged 23 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c047495
club model update | poc -> leader | contact -> social | service vs tr…
garrettladley May 25, 2024
7227671
fix ci
garrettladley May 25, 2024
ac5fb2b
Merge branch 'main' into 804-update-clubs-model
garrettladley May 25, 2024
6995354
Merge branch 'main' into 804-update-clubs-model
garrettladley May 25, 2024
c410c05
Merge branch 'main' into 804-update-clubs-model
garrettladley May 28, 2024
910ae47
remove legacy references to poc
garrettladley May 28, 2024
a388c91
new endpoint skeleton
garrettladley May 28, 2024
ca8e127
services and transactions progress
garrettladley May 29, 2024
8152032
track
garrettladley May 29, 2024
ac90e21
controller and transactions complete | rename from 'pagination' -> 'p…
garrettladley May 31, 2024
06c0789
Merge branch 'main' into 804-update-clubs-model
garrettladley May 31, 2024
be94e0f
fix missing pkeys and commas
garrettladley May 31, 2024
189cf36
fix & format .sql
garrettladley May 31, 2024
45dcbd6
debug commit for mb
garrettladley Jun 1, 2024
34b6aa8
variety of fixes | comment out broken redis
garrettladley Jun 1, 2024
fd4d722
docker magic
garrettladley Jun 1, 2024
b6e1add
track files bc git commit -am doesn't
garrettladley Jun 1, 2024
a812bb6
disable default user
garrettladley Jun 1, 2024
8e80e51
update comments
garrettladley Jun 1, 2024
5852cf0
update comments
garrettladley Jun 1, 2024
e0418ac
Merge branch 'main' into 804-update-clubs-model
garrettladley Jun 4, 2024
d36c779
tested in postman
garrettladley Jun 5, 2024
de68bb2
Merge branch 'main' into 804-update-clubs-model
garrettladley Jun 5, 2024
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
25 changes: 16 additions & 9 deletions backend/database/super.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,21 @@ func SuperUser(superUserSettings config.SuperUserSettings) (*models.User, error)

func SuperClub() models.Club {
return models.Club{
Name: "SAC",
Preview: "SAC",
Description: "SAC",
NumMembers: 0,
IsRecruiting: true,
RecruitmentCycle: models.Always,
RecruitmentType: models.Application,
ApplicationLink: "https://generatenu.com/apply",
Logo: "https://aws.amazon.com/s3",
Name: "SAC",
Preview: "SAC",
Description: "SAC",
NumMembers: 0,
Recruitment: models.Recruitment{
Cycle: models.Always,
Type: models.RecruitmentTypeApplication,
IsRecruiting: true,
Applications: []models.Application{
{
Title: "General Applications",
Link: "generatenu.com/apply",
},
},
},
Logo: "https://aws.amazon.com/s3",
}
}
10 changes: 6 additions & 4 deletions backend/entities/clubs/base/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package base

import (
p "github.com/GenerateNU/sac/backend/auth"
"github.com/GenerateNU/sac/backend/entities/clubs/contacts"
"github.com/GenerateNU/sac/backend/entities/clubs/events"
"github.com/GenerateNU/sac/backend/entities/clubs/followers"
"github.com/GenerateNU/sac/backend/entities/clubs/leadership"
"github.com/GenerateNU/sac/backend/entities/clubs/members"
"github.com/GenerateNU/sac/backend/entities/clubs/pocs"
"github.com/GenerateNU/sac/backend/entities/clubs/recruitment"
"github.com/GenerateNU/sac/backend/entities/clubs/socials"
"github.com/GenerateNU/sac/backend/entities/clubs/tags"
authMiddleware "github.com/GenerateNU/sac/backend/middleware/auth"

Expand All @@ -20,9 +21,10 @@ func ClubRoutes(clubParams types.RouteParams) {
tags.ClubTag(clubParams)
followers.ClubFollower(clubParams)
members.ClubMember(clubParams)
contacts.ClubContact(clubParams)
leadership.ClubLeader(clubParams)
events.ClubEvent(clubParams)
pocs.ClubPointOfContact(clubParams)
socials.ClubSocial(clubParams)
recruitment.ClubRecruitment(clubParams)
}

func ClubRouter(clubParams types.RouteParams) fiber.Router {
Expand Down
4 changes: 2 additions & 2 deletions backend/entities/clubs/base/service.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package base

import (
"fmt"
"errors"

"github.com/GenerateNU/sac/backend/entities/clubs"
"github.com/GenerateNU/sac/backend/entities/models"
Expand Down Expand Up @@ -59,7 +59,7 @@ func (c *ClubService) UpdateClub(id string, clubBody UpdateClubRequestBody) (*mo
}

if utilities.AtLeastOne(clubBody, UpdateClubRequestBody{}) {
return nil, fmt.Errorf("at least one field must be present")
return nil, errors.New("at least one field must be present")
}

if err := utilities.Validate(c.Validate, clubBody); err != nil {
Expand Down
69 changes: 0 additions & 69 deletions backend/entities/clubs/contacts/controller.go

This file was deleted.

8 changes: 0 additions & 8 deletions backend/entities/clubs/contacts/models.go

This file was deleted.

20 changes: 0 additions & 20 deletions backend/entities/clubs/contacts/routes.go

This file was deleted.

49 changes: 0 additions & 49 deletions backend/entities/clubs/contacts/service.go

This file was deleted.

Loading
Loading