implement basic login

This commit is contained in:
Anika Raemer 2025-10-07 19:27:35 +02:00
parent bdd90b50d9
commit 7a6f5b5bcd
18 changed files with 222 additions and 35 deletions

View file

@ -0,0 +1,7 @@
/**
* Defines a login request
*/
export class LoginRequestDto {
userName?: string;
password?: string;
}

View file

@ -0,0 +1,10 @@
import { UserDto } from "./UserDto.js";
/**
* Response to a successful login
*/
export class LoginResponseDto {
userData?: UserDto;
token?: string;
expiryDate? : Date;
}

View file

@ -0,0 +1,15 @@
import { AbstractDto } from "./AbstractDto.js";
import { RecipeIngredientGroupDto } from "./RecipeIngredientGroupDto.js";
import { RecipeInstructionStepDto } from "./RecipeInstructionStepDto.js";
/**
* DTO describing a recipe
*/
export class RecipeDto extends AbstractDto {
title!: string;
amount?: number
amountDescription?: string;
instructions!: RecipeInstructionStepDto[];
ingredientGroups!: RecipeIngredientGroupDto[];
}

View file

@ -0,0 +1,10 @@
import { AbstractDto } from "./AbstractDto.js";
export class RecipeIngredientDto extends AbstractDto{
name!: string;
subtext?: string;
amount?: number;
unit?: string;
sortOrder!: number;
ingredientGroupId?: string;
}

View file

@ -0,0 +1,9 @@
import { AbstractDto } from "./AbstractDto.js";
import { RecipeIngredientDto } from "./RecipeIngredientDto.js";
export class RecipeIngredientGroupDto extends AbstractDto{
title?: string;
sortOrder!: number;
recipeId?: string;
ingredients!: RecipeIngredientDto[];
}

View file

@ -0,0 +1,8 @@
import { UUID } from "crypto";
import { AbstractDto } from "./AbstractDto.js";
export class RecipeInstructionStepDto extends AbstractDto{
text!: string;
sortOrder!: number;
recipeId?: UUID;
}

View file

@ -0,0 +1,9 @@
import { AbstractDto } from "./AbstractDto.js";
export class UserDto extends AbstractDto {
firstName?: string;
lastName?: string;
userName!: string;
email!: string;
role?: string;
}