Handout management

This commit is contained in:
Bastian Wagner
2024-10-20 14:49:42 +02:00
parent 5e2b900b18
commit aa9abdd512
37 changed files with 754 additions and 67 deletions

View File

@@ -2,6 +2,7 @@ import {
Body,
Controller,
Get,
Param,
Post,
Put,
Req,
@@ -12,6 +13,7 @@ import { AuthenticatedRequest } from 'src/model/interface/authenticated-request.
import { AuthGuard } from 'src/core/guards/auth.guard';
import { Key } from 'src/model/entitites';
import { CreateKeySystemDto } from 'src/model/dto/create-key-system.dto';
import { HandoverKeyDto } from 'src/model/dto';
@UseGuards(AuthGuard)
@Controller('key')
@@ -34,7 +36,24 @@ export class KeyController {
}
@Post('system')
createKeySystem(@Req() req: AuthenticatedRequest, @Body() body: CreateKeySystemDto) {
createKeySystem(
@Req() req: AuthenticatedRequest,
@Body() body: CreateKeySystemDto,
) {
return this.service.createKeySystem(req.user, body);
}
@Post(':id/handover')
handoutKey(
@Req() req: AuthenticatedRequest,
@Body() body: any,
@Param('id') id: string,
) {
return this.service.handoverKey(req.user, body, id);
}
@Get(':id/handover')
getKeyHandouts(@Req() req: AuthenticatedRequest, @Param('id') id: string) {
return this.service.getKeyHandovers(req.user, id);
}
}