add dtos and fix entities including migrations

This commit is contained in:
Anika Raemer 2025-09-27 18:21:10 +02:00
parent ad6ee64565
commit d94251dea4
9 changed files with 125 additions and 3 deletions

15
src/dtos/RecipeDto.ts Normal file
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,11 @@
import { UUID } from "crypto";
import { AbstractDto } from "./AbstractDto.js";
export class RecipeIngredientDto extends AbstractDto{
name?: string;
subtext?: string;
amount?: number;
unit?: string;
sortOrder?: number;
ingredientGroupId?: UUID;
}

View file

@ -0,0 +1,10 @@
import { UUID } from "crypto";
import { AbstractDto } from "./AbstractDto.js";
import { RecipeIngredientDto } from "./RecipeIngredientDto.js";
export class RecipeIngredientGroupDto extends AbstractDto{
title?: string;
sortOrder?: string;
recipeId?: UUID;
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;
}