mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 16:09:35 +01:00
feat(production): Zutaten zum Rezept verwalten (#27)
Ingredient als Child Entity des Recipe Aggregates implementiert. Folgt dem Article → SalesUnit Pattern als Full Vertical Slice. Domain: IngredientId, Ingredient, IngredientDraft, Recipe.addIngredient/removeIngredient Application: AddRecipeIngredient, RemoveRecipeIngredient Use Cases Infrastructure: IngredientEntity (JPA), REST-Endpoints (POST/DELETE), Liquibase Migration Tests: RecipeTest (9 neue), IngredientTest (11 Tests)
This commit is contained in:
parent
dcaa43dc2c
commit
bee3f28b5f
22 changed files with 912 additions and 5 deletions
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
|
||||
<changeSet id="011-create-recipe-ingredients-table" author="effigenix">
|
||||
<createTable tableName="recipe_ingredients">
|
||||
<column name="id" type="VARCHAR(36)">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="recipe_id" type="VARCHAR(36)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="position" type="INT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="article_id" type="VARCHAR(36)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="quantity" type="DECIMAL(19,6)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="uom" type="VARCHAR(20)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="sub_recipe_id" type="VARCHAR(36)"/>
|
||||
<column name="substitutable" type="BOOLEAN" defaultValueBoolean="false">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
|
||||
<addForeignKeyConstraint baseTableName="recipe_ingredients" baseColumnNames="recipe_id"
|
||||
referencedTableName="recipes" referencedColumnNames="id"
|
||||
constraintName="fk_recipe_ingredients_recipe"
|
||||
onDelete="CASCADE"/>
|
||||
|
||||
<addUniqueConstraint tableName="recipe_ingredients" columnNames="recipe_id, position"
|
||||
constraintName="uq_recipe_ingredient_position"/>
|
||||
|
||||
<createIndex tableName="recipe_ingredients" indexName="idx_recipe_ingredients_recipe_id">
|
||||
<column name="recipe_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
@ -15,5 +15,6 @@
|
|||
<include file="db/changelog/changes/008-add-masterdata-permissions.xml"/>
|
||||
<include file="db/changelog/changes/009-create-storage-location-schema.xml"/>
|
||||
<include file="db/changelog/changes/010-create-recipe-schema.xml"/>
|
||||
<include file="db/changelog/changes/011-create-recipe-ingredients-table.xml"/>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue