add dtos and fix entities including migrations
This commit is contained in:
parent
ad6ee64565
commit
d94251dea4
9 changed files with 125 additions and 3 deletions
15
src/dtos/RecipeDto.ts
Normal file
15
src/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[];
|
||||
}
|
||||
11
src/dtos/RecipeIngredientDto.ts
Normal file
11
src/dtos/RecipeIngredientDto.ts
Normal 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;
|
||||
}
|
||||
10
src/dtos/RecipeIngredientGroupDto.ts
Normal file
10
src/dtos/RecipeIngredientGroupDto.ts
Normal 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[];
|
||||
}
|
||||
8
src/dtos/RecipeInstructionStepDto.ts
Normal file
8
src/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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue