1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 16:19:35 +01:00

feat(production): Produktion starten und Rohstoffverbrauch dokumentieren (StartBatch, RecordConsumption)

PLANNED-Chargen können in Produktion genommen werden (IN_PRODUCTION),
anschließend wird der Rohstoff-Verbrauch pro InputBatch dokumentiert.
Bildet die Grundlage für die Chargen-Genealogie (Tracing).
This commit is contained in:
Sebastian Frick 2026-02-20 12:15:06 +01:00
parent 8c042925eb
commit a9f5956812
31 changed files with 1733 additions and 11 deletions

View file

@ -0,0 +1,48 @@
<?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="019-create-batch-consumptions-table" author="effigenix">
<createTable tableName="batch_consumptions">
<column name="id" type="varchar(36)">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="batch_id" type="varchar(36)">
<constraints nullable="false"
foreignKeyName="fk_consumption_batch"
references="batches(id)"/>
</column>
<column name="input_batch_id" type="varchar(36)">
<constraints nullable="false"/>
</column>
<column name="article_id" type="varchar(36)">
<constraints nullable="false"/>
</column>
<column name="quantity_used_amount" type="decimal(19,6)">
<constraints nullable="false"/>
</column>
<column name="quantity_used_unit" type="varchar(10)">
<constraints nullable="false"/>
</column>
<column name="consumed_at" type="timestamptz">
<constraints nullable="false"/>
</column>
</createTable>
<addUniqueConstraint tableName="batch_consumptions"
columnNames="batch_id, input_batch_id"
constraintName="uq_consumption_batch_input"/>
<createIndex tableName="batch_consumptions" indexName="idx_consumption_batch_id">
<column name="batch_id"/>
</createIndex>
<createIndex tableName="batch_consumptions" indexName="idx_consumption_input_batch_id">
<column name="input_batch_id"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View file

@ -23,5 +23,6 @@
<include file="db/changelog/changes/016-create-batch-number-sequences-table.xml"/>
<include file="db/changelog/changes/017-timestamps-to-timestamptz.xml"/>
<include file="db/changelog/changes/018-add-article-id-to-recipes.xml"/>
<include file="db/changelog/changes/019-create-batch-consumptions-table.xml"/>
</databaseChangeLog>