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

4 create the objects user post -- ready for review #119

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
14a0544
Tweaked CICD, removed husky, removed fly deployment
dogezen Oct 21, 2024
c5812af
Merge remote-tracking branch 'upstream/main'
dogezen Oct 24, 2024
39a987c
setting up Jasmine testing. First step in ensuring the pipeline will …
VictorsCodingCorner Oct 28, 2024
3d2add5
First untested version of an implementation for comments on posts.
OliverLundhAndersson Oct 28, 2024
5388277
updated prisma to work in accordance to the api spec
Badde00 Oct 29, 2024
b63509c
Removal of ";" i multiple files
OliverLundhAndersson Oct 29, 2024
9c33731
Removal of "," i multiple files and adjustments to match prettier
OliverLundhAndersson Oct 29, 2024
8498242
Added migration for comments
OliverLundhAndersson Oct 29, 2024
a84f821
Updated prisma model for Cohort. Added list of Cohorts to User model
Oct 29, 2024
a2c6485
Updated API spec to relfect cohort model changes
Oct 29, 2024
92c29f9
Added Cohort to User model in Api spec
Oct 29, 2024
22c9d38
Almost finished, the one thing remaining is to get the correct profil…
LudwigJL Oct 29, 2024
0e52e97
Updated openapi.yml to include API endpoints for comments
OliverLundhAndersson Oct 29, 2024
8d98a00
Merge pull request #8 from boolean-uk/comments
OliverLundhAndersson Oct 29, 2024
9a64f4f
Merge branch 'main' of github.com:boolean-uk/team-dev-server-ex-2410-…
Oct 29, 2024
eda3d0d
Merge branch 'main' of github.com:boolean-uk/team-dev-server-ex-2410-…
Badde00 Oct 29, 2024
4ed88fa
tried to fix merge comments
Badde00 Oct 29, 2024
f824d97
Merge branch 'main' of github.com:boolean-uk/team-dev-server-ex-2410-…
sebgro98 Oct 29, 2024
faf5506
updated actions/checkout to v4
sebgro98 Oct 29, 2024
e5db18e
Merge pull request #18 from boolean-uk/comments-api-spec
sebgro98 Oct 29, 2024
2c1246b
Merge branch 'main' of github.com:boolean-uk/team-dev-server-ex-2410-…
Oct 29, 2024
9021791
Merge pull request #16 from boolean-uk/32-update-prisma-to-represent-…
sebgro98 Oct 29, 2024
3f99720
mege conflicts
sebgro98 Oct 29, 2024
07ce118
Merge pull request #11 from boolean-uk/Setting-up-Automated-testing-B…
sebgro98 Oct 29, 2024
1e3f900
Merge pull request #14 from boolean-uk/9-backend-design-cohort-update…
Badde00 Oct 29, 2024
63ba8b4
Solved the Profile issue with include, I believe everything should be…
LudwigJL Oct 29, 2024
e825966
post domain ready for review
LudwigJL Oct 30, 2024
1df6944
Merge branch 'main' locally, have resolved all merge conflicts
LudwigJL Oct 30, 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
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: CI
on: [push, pull_request]
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JWT_TOKEN: ${{ secrets.JWT_TOKEN }}
JWT_EXPIRY: ${{ secrets.JWT_EXPIRY }}
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -14,4 +10,3 @@ jobs:
node-version: 'lts/*'
- run: npm ci
- run: npx eslint src
- run: npx prisma migrate reset --force --skip-seed
21 changes: 0 additions & 21 deletions .github/workflows/deploy.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Jasmine Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run Jasmine tests
run: npm test
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

36 changes: 0 additions & 36 deletions Dockerfile

This file was deleted.

196 changes: 196 additions & 0 deletions docs/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tags:
- name: post
- name: cohort
- name: log
- name: comment
paths:
/users:
post:
Expand Down Expand Up @@ -285,6 +286,72 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
get:
tags:
- cohort
summary: Get all cohorts
description: Get all cohorts
operationId: getCohorts
security:
- bearerAuth: []
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/AllCohorts'

/comments:
post:
tags:
- comment
summary: Create a new comment
description: Allows a logged-in user to create a comment.
operationId: createComment
security:
- bearerAuth: [ ]
requestBody:
description: Comment creation payload
content:
application/json:
schema:
$ref: '#/components/schemas/CreateComment'
responses:
'201':
description: Comment successfully created
content:
application/json:
schema:
$ref: '#/components/schemas/CommentResponse'
'400':
description: Invalid input
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

get:
tags:
- comment
summary: Retrieve all comments
description: Get a list of all comments.
operationId: getAllComments
security:
- bearerAuth: [ ]
responses:
'200':
description: A list of comments
content:
application/json:
schema:
$ref: '#/components/schemas/AllComments'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

components:
securitySchemes:
Expand Down Expand Up @@ -312,12 +379,57 @@ components:
properties:
id:
type: integer
name:
type: string
createdAt:
type: string
format: string
updatedAt:
type: string
format: string
startDate:
type: string
format: string
endDate:
type: string
format: string
users:
type: array
items:
$ref: '#/components/schemas/UserNoCohorts'

CohortNoUser:
type: object
properties:
id:
type: integer
name:
type: string
createdAt:
type: string
format: string
updatedAt:
type: string
format: string
startDate:
type: string
format: string
endDate:
type: string
format: string

AllCohorts:
type: object
properties:
status:
type: string
data:
type: object
properties:
cohorts:
type: array
items:
$ref: '#/components/schemas/Cohort'

AllUsers:
type: object
Expand All @@ -333,6 +445,30 @@ components:
$ref: '#/components/schemas/User'

User:
type: object
properties:
id:
type: integer
email:
type: string
role:
type: string
cohortId:
type: integer
firstName:
type: string
lastName:
type: string
bio:
type: string
githubUrl:
type: string
cohorts:
type: array
items:
$ref: '#/components/schemas/CohortNoUser'

UserNoCohorts:
type: object
properties:
id:
Expand Down Expand Up @@ -535,3 +671,63 @@ components:
type: integer
content:
type: string
CreateComment:
type: object
properties:
content:
type: string
description: The content of the comment
postId:
type: integer
description: The ID of the post to which the comment belongs

CommentResponse:
type: object
properties:
status:
type: string
example: success
data:
type: object
properties:
comment:
$ref: '#/components/schemas/Comment'

AllComments:
type: object
properties:
status:
type: string
example: success
data:
type: object
properties:
comments:
type: array
items:
$ref: '#/components/schemas/Comment'

Comment:
type: object
properties:
id:
type: integer
content:
type: string
postId:
type: integer
author:
type: object
properties:
id:
type: integer
firstName:
type: string
lastName:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
File renamed without changes.
42 changes: 0 additions & 42 deletions fly.toml

This file was deleted.

Loading
Loading