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

Release 13 #209

Merged
merged 120 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
f52ce3b
feat: implement update desk type
woerndle Jan 23, 2023
ce4060e
feat: edit resource room
stefanpfahler Jan 23, 2023
12a1f10
chore: add tests for update room usecase
stefanpfahler Jan 23, 2023
f05a47d
Merge branch '55-edit-resources' of github.com:amosproj/amos2022ws05-…
stefanpfahler Jan 23, 2023
4a73470
fix: merge conflict resolved
stefanpfahler Jan 23, 2023
19a4678
feat: edit resource desk
woerndle Jan 23, 2023
c0127b2
feat: add updating resources for floors
stefanpfahler Jan 23, 2023
8c9f126
chore: add tests for update floor usecase
stefanpfahler Jan 23, 2023
aa27141
feat: edit desk tests
woerndle Jan 23, 2023
a05eabf
feat: edit resource building
stefanpfahler Jan 23, 2023
544f96b
chore: add tests for update building usecase
stefanpfahler Jan 23, 2023
268ff64
Merge branch '55-edit-resources' of github.com:amosproj/amos2022ws05-…
stefanpfahler Jan 23, 2023
7974026
fix: resolve open conflicts
woerndle Jan 23, 2023
20da3e5
fix: adjust styling
woerndle Jan 23, 2023
6650cbf
feat: init ui
woerndle Jan 23, 2023
ec5cf51
init restore page
xilef45 Jan 24, 2023
22d5e35
Merge branch 'develop' into restore-ressources
xilef45 Jan 25, 2023
9cff3d6
backend call mockups
xilef45 Jan 25, 2023
44e7f7c
update ui
xilef45 Jan 25, 2023
63fee84
implement data load
xilef45 Jan 25, 2023
eb8ef97
fixed date issue
n3rdc4ptn Jan 27, 2023
0039d6f
fixed type issue with "Function" Type
n3rdc4ptn Jan 27, 2023
7f93b60
return userName in getDesks route
jantiegges Jan 27, 2023
9912cbc
added desks endpoint for aggregating desks
n3rdc4ptn Jan 27, 2023
875a611
Merge branch '85-refactor-book-a-desk-experience' of github.com:amosp…
n3rdc4ptn Jan 27, 2023
dc1bc85
improved add bookings ux
n3rdc4ptn Jan 27, 2023
0830cd4
added booked information to see if a table is already booked
n3rdc4ptn Jan 27, 2023
a0f6d13
fixed time issue
n3rdc4ptn Jan 27, 2023
71f2652
add restoration logic in backend
Faoilthiama Jan 27, 2023
c4f2383
add tests for restoration
Faoilthiama Jan 27, 2023
af643e9
update frontend for restoration
Faoilthiama Jan 27, 2023
4c91afb
connect frontend and backend for resource restoration
xilef45 Jan 27, 2023
4f1b9b4
filter resources to not show deleted
xilef45 Jan 27, 2023
1254640
Fix missing date bug @ bookings page
eddyhakimi Jan 27, 2023
698da41
Merge pull request #191 from amosproj/182-date-time-issue-edit-booking
eddyhakimi Jan 27, 2023
966163f
fix type error
jantiegges Jan 28, 2023
3bfd896
Merge pull request #192 from amosproj/85-refactor-book-a-desk-experience
n3rdc4ptn Jan 29, 2023
bc6bfcc
simple fix for the centering of the container
n3rdc4ptn Jan 29, 2023
2b7c3e6
Merge branch 'develop' of github.com:amosproj/amos2022ws05-shared-des…
n3rdc4ptn Jan 29, 2023
26691aa
fixed date issue
n3rdc4ptn Jan 29, 2023
c8fa821
Merge branch 'develop' into 190-time-issue-book-a-desk-bookings
n3rdc4ptn Jan 29, 2023
f98226a
redone change after merge
n3rdc4ptn Jan 29, 2023
b797ded
Merge branch 'develop' into restore-ressources
xilef45 Jan 29, 2023
af5e279
fix import bug
jantiegges Jan 30, 2023
85950c5
added types to fix typescript build error
n3rdc4ptn Jan 30, 2023
b56429c
fix naming issue
jantiegges Jan 30, 2023
e10902b
feat: adjust models and usecases to return updated entity
woerndle Jan 30, 2023
44b3ab0
feat: create fe service layer for resource endpoints
woerndle Jan 30, 2023
86b1bc0
feat: create edit building modal component
woerndle Jan 30, 2023
72d37fa
feat: create edit floor modal component
woerndle Jan 30, 2023
e7c0289
feat: create edit room modal component
woerndle Jan 30, 2023
8b6ffe0
feat: create edit desk modal component
woerndle Jan 30, 2023
98fb542
fix: add desk type column
woerndle Jan 30, 2023
a1f01d7
feat: create edit desk type modal component
woerndle Jan 30, 2023
b7a8be9
feat: connect edit resource modals with resource table entries
woerndle Jan 30, 2023
2d9d9b6
add resource usecases
jantiegges Jan 30, 2023
b3c448c
made hierarchial fetching optional
n3rdc4ptn Jan 30, 2023
00bb508
add new resources controller
jantiegges Jan 30, 2023
530a0c2
fix: adjust error messages for update building
woerndle Jan 30, 2023
308656e
fix: adjust floor error messages
woerndle Jan 30, 2023
52abcc0
fix: adjust room error messages
woerndle Jan 30, 2023
fc524f2
fix: adjust edit desk error messages
woerndle Jan 30, 2023
a62ec84
fix: edit desk types error messages
woerndle Jan 30, 2023
047107a
Merge pull request #201 from amosproj/edit-resource-ui
stefanpfahler Jan 30, 2023
48f72a8
feat: create register admin dto
woerndle Jan 30, 2023
05b7ce5
feat: setup response obj and mapping
woerndle Jan 30, 2023
fab1660
feat: setup register admin usecase
woerndle Jan 30, 2023
f67fd56
feat: setup register admin endpoint
woerndle Jan 30, 2023
fac9e73
added getAll in Backend
xilef45 Jan 30, 2023
6cce23b
fix: adjust usecase and enpoint interface according to architecture
woerndle Jan 30, 2023
0699561
feat: provide tests for register admin usecase
woerndle Jan 30, 2023
c22f306
Merge branch 'develop' into 55-edit-resources
woerndle Jan 30, 2023
e41690b
Merge pull request #193 from amosproj/190-time-issue-book-a-desk-book…
eddyhakimi Jan 30, 2023
bbf17e8
Merge remote-tracking branch 'origin/185-resource-filterbar' into 185…
jantiegges Jan 31, 2023
dfdde28
modify models in be
jantiegges Jan 31, 2023
9dcc18a
fix resource filterbar
jantiegges Jan 31, 2023
449673f
add new tests
jantiegges Jan 31, 2023
431c27a
add get all routes for resources
xilef45 Jan 31, 2023
f36afef
fix frontend restore resources
xilef45 Jan 31, 2023
3c6808e
Merge pull request #181 from amosproj/restore-ressources
xilef45 Jan 31, 2023
d85fdd8
disable admin from deleting themself and their own rights
xilef45 Jan 31, 2023
338639d
add guards for last admin
xilef45 Jan 31, 2023
130f154
added tests
xilef45 Jan 31, 2023
5a00f3b
fixes build error
xilef45 Jan 31, 2023
96ee96f
Merge pull request #204 from amosproj/87-last-admin
xilef45 Jan 31, 2023
0f2bc88
update and add screenshots
xilef45 Jan 31, 2023
dd935ce
update delete modals
xilef45 Jan 31, 2023
2392a58
add tests
xilef45 Jan 31, 2023
b9f53f4
Fix nextjs production build
eddyhakimi Jan 31, 2023
344a2c9
Merge branch 'develop' into 55-edit-resources
woerndle Jan 31, 2023
ab72a7b
fix: fix typo
woerndle Jan 31, 2023
a6c39e8
Add initial registeration method to AuthService
eddyhakimi Jan 31, 2023
a40a800
Merge pull request #173 from amosproj/55-edit-resources
woerndle Jan 31, 2023
ebf81ff
Add initial registration ui
eddyhakimi Jan 31, 2023
2585bbd
Handle initial registration submit
eddyhakimi Jan 31, 2023
d95d2dc
fix: adjust endpoint to fe
woerndle Jan 31, 2023
0468b3f
Adjust fe error handling to backend
eddyhakimi Jan 31, 2023
1ffbb39
Merge pull request #205 from amosproj/83-initial-admin-registration
woerndle Jan 31, 2023
f7a971f
Merge branch 'develop' into 185-resource-filterbar
jantiegges Jan 31, 2023
5296a62
fix + add emails
xilef45 Jan 31, 2023
7f90c8f
resolve merge conflicts with develop
jantiegges Jan 31, 2023
e3e7c73
email fixes
xilef45 Jan 31, 2023
de0a266
fix small bugs
xilef45 Jan 31, 2023
2fc96d6
delete modal for bookings
xilef45 Jan 31, 2023
6242f6a
change direction for index page
xilef45 Jan 31, 2023
e06d257
Merge pull request #207 from amosproj/fix-email-bugs
xilef45 Jan 31, 2023
72a9d30
Created sprint 13 folder
qy21gafy Jan 31, 2023
72f430c
Submitted PO homework for sprint 13
qy21gafy Jan 31, 2023
31bb628
Submitted Demo Day Slide authored by Svenja Strobel
qy21gafy Jan 31, 2023
eb6fe1a
Deleted dummy file from sprint 13
qy21gafy Jan 31, 2023
99f349c
fix typos
xilef45 Jan 31, 2023
c620ade
Merge pull request #208 from amosproj/fix-email-bugs
xilef45 Jan 31, 2023
1281f81
Merge pull request #202 from amosproj/185-resource-filterbar
n3rdc4ptn Jan 31, 2023
c2cf9d7
fix Type error
xilef45 Jan 31, 2023
73570ca
Create demo-day-video.mp4
xilef45 Jan 31, 2023
834cf0f
Revert "Create demo-day-video.mp4"
xilef45 Jan 31, 2023
ce4b397
Create demo-day-video.mp4
xilef45 Jan 31, 2023
d21ed58
Update demo-day-video.mp4
xilef45 Jan 31, 2023
8646497
Revert "Update demo-day-video.mp4"
xilef45 Jan 31, 2023
db586c1
Update demo-day-video.mp4
xilef45 Jan 31, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ bin/
src/deskstar-backend/DeskstarSolution.sln.DotSettings.user
*.cs~
src/deskstar-backend/Deskstar/out/
.devcontainer/.env
Binary file added Deliverables/sprint-13/demo-day-slide.pdf
Binary file not shown.
Binary file added Deliverables/sprint-13/demo-day-video.mp4
Binary file not shown.
Binary file added Deliverables/sprint-13/feature-board.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Deliverables/sprint-13/planning-documents.pdf
Binary file not shown.
Binary file modified Documentation/Database Model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Screenshot/user_page_manage_delete_only_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Screenshot/user_page_manage_edit_only_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Screenshot/user_page_manage_only_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
143 changes: 87 additions & 56 deletions src/deskstar-backend/Deskstar/Controllers/AuthController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Deskstar.Core.Exceptions;
using Deskstar.Entities;
using Deskstar.Models;
using Deskstar.Usecases;
using Microsoft.AspNetCore.Authorization;
Expand All @@ -10,68 +12,97 @@ namespace Deskstar.Controllers;
[Produces("text/plain")]
public class AuthController : ControllerBase
{
private readonly ILogger<AuthController> _logger;
private readonly IAuthUsecases _authUsecases;
private readonly IConfiguration _configuration;
private readonly ILogger<AuthController> _logger;
private readonly IAuthUsecases _authUsecases;
private readonly IConfiguration _configuration;

public AuthController(ILogger<AuthController> logger, IAuthUsecases authUsecases, IConfiguration configuration)
{
_logger = logger;
_authUsecases = authUsecases;
_configuration = configuration;
}

public AuthController(ILogger<AuthController> logger, IAuthUsecases authUsecases, IConfiguration configuration)
/// <summary>
/// Login functionality
/// </summary>
/// <returns> JWT, if users is approved and psw is correct </returns>
/// <remarks>
/// Sample request:
/// Post /auth/createToken
/// </remarks>
///
/// <response code="200">Login succesful </response>
/// <response code="401">Credentials wrong or user not approved</response>
[HttpPost("createToken")]
[AllowAnonymous]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(LoginResponse), StatusCodes.Status401Unauthorized)]
public IActionResult CreateToken(CreateTokenUser user)
{
var returnValue = _authUsecases.CheckCredentials(user.MailAddress, user.Password);
if (returnValue.Message == LoginReturn.Ok)
{
_logger = logger;
_authUsecases = authUsecases;
_configuration = configuration;
return Ok(_authUsecases.CreateToken(_configuration, user.MailAddress));
}

/// <summary>
/// Login functionality
/// </summary>
/// <returns> JWT, if users is approved and psw is correct </returns>
/// <remarks>
/// Sample request:
/// Post /auth/createToken
/// </remarks>
///
/// <response code="200">Login succesful </response>
/// <response code="401">Credentials wrong or user not approved</response>
[HttpPost("createToken")]
[AllowAnonymous]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(LoginResponse), StatusCodes.Status401Unauthorized)]
public IActionResult CreateToken(CreateTokenUser user)
{
var returnValue = _authUsecases.CheckCredentials(user.MailAddress, user.Password);
if (returnValue.Message == LoginReturn.Ok)
{
return Ok(_authUsecases.CreateToken(_configuration, user.MailAddress));
}
return Unauthorized(returnValue.Message.ToString());
}

return Unauthorized(returnValue.Message.ToString());
/// <summary>
/// Register functionality
/// </summary>
/// <remarks>
/// Sample request:
/// Post /auth/register
/// </remarks>
///
/// <response code="200">User added to db</response>
/// <response code="400">Mail already in use</response>
/// <response code="404">Company not found</response>
[HttpPost("register")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(RegisterResponse), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(RegisterResponse), StatusCodes.Status404NotFound)]
public IActionResult Register(RegisterUser registerUser)
{
var result = _authUsecases.RegisterUser(registerUser);
return result.Message switch
{
RegisterReturn.Ok => Ok(),
RegisterReturn.CompanyNotFound => NotFound(result.Message.ToString()),
_ => BadRequest(result.Message.ToString())
};
}
/// <summary>
/// Register functionality
/// </summary>
/// <remarks>
/// Sample request:
/// Post /auth/registerAdmin
/// </remarks>
///
/// <response code="200">Admin added to db</response>
/// <response code="400">Mail or Company name already in use</response>
[HttpPost("registerAdmin")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public IActionResult RegisterAdmin(RegisterAdminDto registerAdmin)
{
try
{
var admin = _authUsecases.RegisterAdmin(registerAdmin.FirstName, registerAdmin.LastName, registerAdmin.MailAddress, registerAdmin.Password, registerAdmin.CompanyName);
return Ok();
}

/// <summary>
/// Register functionality
/// </summary>
/// <remarks>
/// Sample request:
/// Post /auth/register
/// </remarks>
///
/// <response code="200">User added to db</response>
/// <response code="400">Mail already in use</response>
/// <response code="404">Company not found</response>
[HttpPost("register")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(RegisterResponse), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(RegisterResponse), StatusCodes.Status404NotFound)]
public IActionResult Register(RegisterUser registerUser)
catch (ArgumentInvalidException e)
{
return BadRequest(e.Message);
}
catch (Exception e)
{
var result = _authUsecases.RegisterUser(registerUser);
return result.Message switch
{
RegisterReturn.Ok => Ok(),
RegisterReturn.CompanyNotFound => NotFound(result.Message.ToString()),
_ => BadRequest(result.Message.ToString())
};
return Problem(statusCode: 500, detail:e.Message);
}
}
}
}
Loading