Skip to content

Commit

Permalink
PLZ is now CHAR(5) not VARCHAR(5) (#1660)
Browse files Browse the repository at this point in the history
* adding mongodb and minio to core depencies in docker-compose.yml (#1649)

Co-authored-by: Sven Roman Reinhard <[email protected]>

* fix(ci): try disabling coverage again

* adding äÄöÖüÜߧ²³°´? to allowed chars in sql play ground (#1647)

adding äÄöÖüܧ²³°´ to allowed chars in sql play ground

Co-authored-by: Sven Roman Reinhard <[email protected]>

* [API] Add group creation and registration functionality (#1640)

* #1633

* Create model for groups (#1633)

* Add group controller (#1634)

* Add group service (#1634)

* Add migration for user group field (#1635)

* Add Controller for Group Registration (#1636)

* Add Service for Group Registration (#1636)

* Add MembershipExceedException (#1637)

* Correct lint errors (#1632)

* docs(core): update api docs with group routes

---------

Co-authored-by: Jonas Kuche <[email protected]>

---------

Co-authored-by: Sven Roman Reinhard <[email protected]>
Co-authored-by: Jonas Kuche <[email protected]>
Co-authored-by: Sophie Methe <[email protected]>
Co-authored-by: Jonas Kuche <[email protected]>
  • Loading branch information
5 people authored May 28, 2024
1 parent 056e187 commit 986a81a
Show file tree
Hide file tree
Showing 12 changed files with 912 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/check-fbs-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ jobs:
name: Run ${{ inputs.name }} Tests
with:
arguments: ${{ inputs.testArguments }}
- uses: gradle/gradle-build-action@v2
name: Generate ${{ inputs.name }} Coverage
if: ${{ inputs.coverageArguments }}
with:
arguments: ${{ inputs.coverageArguments }}
# Disabled because of coverals errors
# - uses: gradle/gradle-build-action@v2
# name: Generate ${{ inputs.name }} Coverage
# if: ${{ inputs.coverageArguments }}
# with:
# arguments: ${{ inputs.coverageArguments }}
# - uses: ./.github/actions/retry-codecov
# if: ${{ inputs.coverageFilesLocation }}
# name: Upload Coverage Report
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ services:
depends_on:
- mysql1
- runner
- mongodb
- minio
ports:
- "127.0.0.1:443:443"
- "127.0.0.1:80:80"
Expand Down
318 changes: 314 additions & 4 deletions modules/fbs-core/api/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ tags:
description: The Semester api
- name: Course Registration
description: The course registration api
- name: Group
description: The group API
- name: GroupMembership
description: The group Membership
- name: Task
description: The task api
- name: Course evaluation
Expand Down Expand Up @@ -859,6 +863,287 @@ paths:
description: Unauthorized
"403":
description: Forbidden
/courses/{cid}/groups:
get:
operationId: getGroups
tags:
- Group
summary: Get a group list
parameters:
- name: cid
in: path
required: true
schema:
type: integer
- name: visible
in: query
required: false
schema:
type: boolean
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Group'
'403':
description: Forbidden
post:
operationId: createGroup
tags:
- Group
summary: Create a new group
parameters:
- name: cid
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GroupRequest'
responses:
'200':
description: Group created
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
'400':
description: Bad Request
'403':
description: Forbidden
/courses/{cid}/groups/{gid}:
get:
operationId: getGroup
tags:
- Group
summary: Get a single group by id
parameters:
- name: cid
in: path
required: true
schema:
type: integer
- name: gid
in: path
required: true
schema:
type: integer
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
'403':
description: Forbidden
'404':
description: Not Found
put:
operationId: updateGroup
tags:
- Group
summary: Update a single group by id
parameters:
- name: cid
in: path
required: true
schema:
type: integer
- name: gid
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GroupRequest'
responses:
'204':
description: No Content
'400':
description: Bad Request
'403':
description: Forbidden
delete:
operationId: deleteGroup
tags:
- Group
summary: Delete a group by id
parameters:
- name: cid
in: path
required: true
schema:
type: integer
- name: gid
in: path
required: true
schema:
type: integer
responses:
'204':
description: No Content
'403':
description: Forbidden
/courses/{cid}/groups/{gid}/users/{uid}:
put:
tags:
- GroupMembership
summary: Add a user to a group within a course
operationId: addUserToGroup
parameters:
- name: cid
in: path
required: true
schema:
type: integer
description: Course ID
- name: gid
in: path
required: true
schema:
type: integer
description: Group ID
- name: uid
in: path
required: true
schema:
type: integer
description: User ID
requestBody:
required: true
content:
application/json:
schema:
type: object
responses:
'200':
description: User added to the group
'403':
description: Forbidden
'404':
description: Resource not found
'409':
description: Membership exceeded
delete:
tags:
- GroupMembership
summary: Remove a user from a group
operationId: removeUserFromGroup
parameters:
- name: cid
in: path
required: true
schema:
type: integer
description: Course ID
- name: gid
in: path
required: true
schema:
type: integer
description: Group ID
- name: uid
in: path
required: true
schema:
type: integer
description: User ID
responses:
'200':
description: User removed from the group
'403':
description: Forbidden
/courses/{cid}/groups/{gid}/users:
delete:
tags:
- GroupMembership
summary: Remove all users from a group
operationId: removeAllUsersFromGroup
parameters:
- name: cid
in: path
required: true
schema:
type: integer
description: Course ID
- name: gid
in: path
required: true
schema:
type: integer
description: Group ID
responses:
'200':
description: All users removed from the group
'403':
description: Forbidden
/users/{uid}/groups:
get:
tags:
- GroupMembership
summary: Retrieve all groups of a specific user
operationId: getUserGroups
parameters:
- name: uid
in: path
required: true
schema:
type: integer
description: User ID
responses:
'200':
description: List of groups
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Group'
'403':
description: Forbidden
/courses/{cid}/groups/{gid}/participants:
get:
tags:
- GroupMembership
summary: Get all course participants who are part of a group
operationId: getGroupParticipants
parameters:
- name: cid
in: path
required: true
schema:
type: integer
description: Course ID
- name: gid
in: path
required: true
schema:
type: integer
description: Group ID
responses:
'200':
description: List of course participants
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
'403':
description: Forbidden
"/courses/{cid}/tasks":
get:
operationId: getCourseTasks
Expand Down Expand Up @@ -3197,10 +3482,9 @@ components:
required: true
securitySchemes:
JWT:
type: apiKey
in: header
name: Authorization
description: Bearer
type: http
scheme: bearer
bearerFormat: JWT
schemas:
User:
type: object
Expand Down Expand Up @@ -3261,6 +3545,32 @@ components:
type: integer
name:
type: string
Group:
type: object
properties:
id:
type: integer
cid:
type: integer
name:
type: string
membership:
type: integer
visible:
type: boolean
GroupRequest:
type: object
properties:
name:
type: string
membership:
type: integer
visible:
type: boolean
required:
- name
- membership
- visible
Task:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
BEGIN;


CREATE TABLE IF NOT EXISTS `fbs`.`group` (
`group_id` INT NOT NULL AUTO_INCREMENT,
`course_id` INT NOT NULL,
`name` VARCHAR(100) NOT NULL,
`membership` INT NOT NULL,
`visible` TINYINT(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`group_id`),
FOREIGN KEY (`course_id`) REFERENCES `fbs`.`course`(`course_id`),
UNIQUE INDEX `groups_groupid_courseid_uindex` (`group_id`, `course_id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

INSERT INTO migration (number) VALUES (20);

COMMIT;


Loading

0 comments on commit 986a81a

Please sign in to comment.