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

Include groups in the Account Scaffold API #924

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Oscariremma
Copy link
Member

In the current Account Scaffold API we can only see the members of entire super groups but to be able to create the emails for individual committee years ([email protected]) we need to be able to get the members of the individual groups.

This PR changes it so that instead of the /api/account-scaffold/v1/supergroups endpoint returning the members directly it returns a list of groups that in turn contain the members as well as details of the groups.

One note is that this changes the signature of the API meaning it is a breaking change and technically we could have considered having this new version under /api/v2... but as the API is not used in anything as of yet (except for a broken version of Goldapps) so I don't think there is any reason to keep the old one around.

Below is an example of the new structure.

[
  {
    "name": "dragit",
    "prettyName": "DragIT",
    "type": "alumni",
    "groups": [
      {
        "name": "drawit2023",
        "prettyName": "DrawIT2023",
        "members": [
          {
            "post": {
              "postId": "844067b3-e95d-4a28-a586-7388f155b8fb",
              "svText": "Kassör",
              "enText": "Treasurer",
              "emailPrefix": "kassor"
            },
            "user": {
              "email": "[email protected]",
              "cid": "shudson",
              "firstName": "Stanley",
              "lastName": "Hudson",
              "nick": "Papa Bear"
            }
          }
        ]
      }
    ],
    "useManagedAccount": false
  }
]

Members can be found under each group individually
@Oscariremma Oscariremma requested a review from Portals as a code owner November 12, 2024 14:30
@Oscariremma Oscariremma merged commit 266ee30 into main Nov 12, 2024
1 check passed
@Oscariremma Oscariremma deleted the feat/expand-groups-for-scaffold-api branch November 12, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants