implement basic login
This commit is contained in:
parent
bdd90b50d9
commit
7a6f5b5bcd
18 changed files with 222 additions and 35 deletions
7
frontend/src/api/dtos/LoginRequestDto.ts
Normal file
7
frontend/src/api/dtos/LoginRequestDto.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* Defines a login request
|
||||
*/
|
||||
export class LoginRequestDto {
|
||||
userName?: string;
|
||||
password?: string;
|
||||
}
|
||||
10
frontend/src/api/dtos/LoginResponseDto.ts
Normal file
10
frontend/src/api/dtos/LoginResponseDto.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { UserDto } from "./UserDto.js";
|
||||
|
||||
/**
|
||||
* Response to a successful login
|
||||
*/
|
||||
export class LoginResponseDto {
|
||||
userData?: UserDto;
|
||||
token?: string;
|
||||
expiryDate? : Date;
|
||||
}
|
||||
15
frontend/src/api/dtos/RecipeDto.ts
Normal file
15
frontend/src/api/dtos/RecipeDto.ts
Normal 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[];
|
||||
}
|
||||
10
frontend/src/api/dtos/RecipeIngredientDto.ts
Normal file
10
frontend/src/api/dtos/RecipeIngredientDto.ts
Normal 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;
|
||||
}
|
||||
9
frontend/src/api/dtos/RecipeIngredientGroupDto.ts
Normal file
9
frontend/src/api/dtos/RecipeIngredientGroupDto.ts
Normal 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[];
|
||||
}
|
||||
8
frontend/src/api/dtos/RecipeInstructionStepDto.ts
Normal file
8
frontend/src/api/dtos/RecipeInstructionStepDto.ts
Normal 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;
|
||||
}
|
||||
9
frontend/src/api/dtos/UserDto.ts
Normal file
9
frontend/src/api/dtos/UserDto.ts
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue