1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 10:19:35 +01:00
effigenix/backend/src/main/resources/db/changelog/changes/009-create-storage-location-schema.xml
Sebastian Frick c474388f32 feat(inventory): StorageLocation Aggregate implementieren (#1)
Vertikaler Slice für Story 1.1 – Lagerort anlegen:

Domain: StorageLocation Aggregate mit VOs (StorageLocationId, StorageLocationName,
StorageType, TemperatureRange), StorageLocationError (sealed interface),
Draft-Records und Repository Interface.

Application: CreateStorageLocation UseCase mit Uniqueness-Check.

Infrastructure: JPA Entity, Mapper, Repository, REST Controller
(POST /api/inventory/storage-locations), Liquibase Migration (009),
InventoryErrorHttpStatusMapper, InventoryUseCaseConfiguration.

Tests: 28 Domain-Unit-Tests, 11 Integration-Tests.

Closes #1
2026-02-19 09:51:48 +01:00

41 lines
1.8 KiB
XML

<?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="009-create-storage-locations-table" author="effigenix">
<createTable tableName="storage_locations">
<column name="id" type="VARCHAR(36)">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="VARCHAR(100)">
<constraints nullable="false" unique="true"/>
</column>
<column name="storage_type" type="VARCHAR(30)">
<constraints nullable="false"/>
</column>
<column name="min_temperature" type="DECIMAL(5,1)"/>
<column name="max_temperature" type="DECIMAL(5,1)"/>
<column name="active" type="BOOLEAN" defaultValueBoolean="true">
<constraints nullable="false"/>
</column>
</createTable>
<sql>
ALTER TABLE storage_locations ADD CONSTRAINT chk_storage_type CHECK (storage_type IN (
'COLD_ROOM', 'FREEZER', 'DRY_STORAGE', 'DISPLAY_COUNTER', 'PRODUCTION_AREA'
));
</sql>
<createIndex tableName="storage_locations" indexName="idx_storage_locations_name">
<column name="name"/>
</createIndex>
<createIndex tableName="storage_locations" indexName="idx_storage_locations_type">
<column name="storage_type"/>
</createIndex>
<createIndex tableName="storage_locations" indexName="idx_storage_locations_active">
<column name="active"/>
</createIndex>
</changeSet>
</databaseChangeLog>