1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 18:49:59 +01:00

feat(inventory): Bestandsposition anlegen (#4)

Stock-Aggregate mit MinimumLevel, MinimumShelfLife und StockDraft.
Quantity/UnitOfMeasure nach shared.common verschoben für BC-übergreifende
Nutzung. REST-Endpoint POST /api/inventory/stocks mit Duplikat-Prüfung,
Validierung und Liquibase-Migration.
This commit is contained in:
Sebastian Frick 2026-02-19 21:33:29 +01:00
parent 7079f12475
commit 5219c93dd1
43 changed files with 1340 additions and 18 deletions

View file

@ -6,10 +6,8 @@ springdoc:
logging:
level:
root: WARN
root: INFO
de.effigenix: INFO
org.springframework.security: WARN
org.hibernate.SQL: WARN
server:
error:

View file

@ -44,8 +44,6 @@ logging:
level:
root: INFO
de.effigenix: DEBUG
org.springframework.security: DEBUG
org.hibernate.SQL: DEBUG
# CORS Configuration
effigenix:

View file

@ -0,0 +1,38 @@
<?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="012-create-stocks-table" author="effigenix">
<createTable tableName="stocks">
<column name="id" type="VARCHAR(36)">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="article_id" type="VARCHAR(36)">
<constraints nullable="false"
foreignKeyName="fk_stocks_article"
references="articles(id)"/>
</column>
<column name="storage_location_id" type="VARCHAR(36)">
<constraints nullable="false"
foreignKeyName="fk_stocks_storage_location"
references="storage_locations(id)"/>
</column>
<column name="minimum_level_amount" type="DECIMAL(12,3)"/>
<column name="minimum_level_unit" type="VARCHAR(20)"/>
<column name="minimum_shelf_life_days" type="INTEGER"/>
</createTable>
<addUniqueConstraint tableName="stocks"
columnNames="article_id, storage_location_id"
constraintName="uq_stocks_article_location"/>
<createIndex tableName="stocks" indexName="idx_stocks_article_id">
<column name="article_id"/>
</createIndex>
<createIndex tableName="stocks" indexName="idx_stocks_storage_location_id">
<column name="storage_location_id"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View file

@ -17,5 +17,6 @@
<include file="db/changelog/changes/010-create-recipe-schema.xml"/>
<include file="db/changelog/changes/011-create-recipe-ingredients-table.xml"/>
<include file="db/changelog/changes/012-create-recipe-production-steps-table.xml"/>
<include file="db/changelog/changes/013-create-stock-schema.xml"/>
</databaseChangeLog>