diff --git a/Admin/Install/db.json b/Admin/Install/db.json index 9b2ab37..780c3a7 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -11,23 +11,30 @@ }, "warehousemgmt_item_item": { "name": "warehousemgmt_item_item", - "type": "VARCHAR(255)", + "type": "INT", + "null": false, + "foreignTable": "itemmgmt_item", + "foreignKey": "itemmgmt_item_id" + }, + "warehousemgmt_item_hassn": { + "name": "warehousemgmt_item_hassn", + "type": "TINYINT(1)", "null": false }, - "warehousemgmt_item_track_type": { - "name": "warehousemgmt_item_track_type", - "type": "TINYINT", + "warehousemgmt_item_haslot": { + "name": "warehousemgmt_item_haslot", + "type": "TINYINT(1)", + "null": false + }, + "warehousemgmt_item_hasstock": { + "name": "warehousemgmt_item_hasstock", + "type": "TINYINT(1)", "null": false }, "warehousemgmt_item_negative": { "name": "warehousemgmt_item_negative", "type": "TINYINT", "null": false - }, - "warehousemgmt_item_": { - "name": "warehousemgmt_item_", - "type": "TINYINT", - "null": false } } }, @@ -46,10 +53,35 @@ "type": "VARCHAR(255)", "null": false }, - "warehousemgmt_stock_type": { - "description": "???", - "name": "warehousemgmt_stock_type", - "type": "TINYINT", + "warehousemgmt_stock_unit": { + "name": "warehousemgmt_stock_unit", + "type": "INT", + "null": false, + "foreignTable": "itemmgmt_item", + "foreignKey": "itemmgmt_item_id" + }, + "warehousemgmt_stock_address": { + "name": "warehousemgmt_stock_address", + "type": "INT", + "null": false, + "foreignTable": "address", + "foreignKey": "address_id" + } + } + }, + "warehousemgmt_stock_type": { + "name": "warehousemgmt_stock_type", + "fields": { + "warehousemgmt_stock_type_id": { + "name": "warehousemgmt_stock_type_id", + "type": "INT", + "null": false, + "primary": true, + "autoincrement": true + }, + "warehousemgmt_stock_type_name": { + "name": "warehousemgmt_stock_type_name", + "type": "VARCHAR(255)", "null": false } } @@ -76,6 +108,14 @@ "foreignTable": "warehousemgmt_stock", "foreignKey": "warehousemgmt_stock_id" }, + "warehousemgmt_stocklocation_type": { + "name": "warehousemgmt_stocklocation_type", + "type": "INT", + "null": true, + "default": "null", + "foreignTable": "warehousemgmt_stock_type", + "foreignKey": "warehousemgmt_stock_type_id" + }, "warehousemgmt_stocklocation_x": { "name": "warehousemgmt_stocklocation_x", "type": "INT", @@ -116,6 +156,14 @@ "foreignTable": "warehousemgmt_stocklocation", "foreignKey": "warehousemgmt_stocklocation_id" }, + "warehousemgmt_stockshelf_type": { + "name": "warehousemgmt_stockshelf_type", + "type": "INT", + "null": true, + "default": "null", + "foreignTable": "warehousemgmt_stock_type", + "foreignKey": "warehousemgmt_stock_type_id" + }, "warehousemgmt_stockshelf_x": { "name": "warehousemgmt_stockshelf_x", "type": "INT", diff --git a/Models/Stock.php b/Models/Stock.php index f3dcd39..c1f45e7 100755 --- a/Models/Stock.php +++ b/Models/Stock.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Modules\WarehouseManagement\Models; +use Modules\Admin\Models\Address; + /** * Warehouse class. * @@ -40,7 +42,9 @@ class Stock */ public string $name = ''; - public int $type = 0; + public int $unit = 0; + + public Address $address; /** * Constructor. diff --git a/Models/StockEvaluation.php b/Models/StockEvaluation.php new file mode 100644 index 0000000..57358b9 --- /dev/null +++ b/Models/StockEvaluation.php @@ -0,0 +1,64 @@ + ['name' => 'warehousemgmt_stock_id', 'type' => 'int', 'internal' => 'id'], 'warehousemgmt_stock_name' => ['name' => 'warehousemgmt_stock_name', 'type' => 'string', 'internal' => 'name'], - 'warehousemgmt_stock_type' => ['name' => 'warehousemgmt_stock_type', 'type' => 'int', 'internal' => 'type'], + 'warehousemgmt_stock_unit' => ['name' => 'warehousemgmt_stock_unit', 'type' => 'int', 'internal' => 'unit'], + 'warehousemgmt_stock_address' => ['name' => 'warehousemgmt_stock_address', 'type' => 'int', 'internal' => 'address'], + ]; + + /** + * Has one relation. + * + * @var array + * @since 1.0.0 + */ + public const OWNS_ONE = [ + 'address' => [ + 'mapper' => AddressMapper::class, + 'external' => 'warehousemgmt_stock_address', + ], ]; /** diff --git a/Models/StockShelf.php b/Models/StockShelf.php index b1238df..b2411e8 100755 --- a/Models/StockShelf.php +++ b/Models/StockShelf.php @@ -36,6 +36,8 @@ class StockShelf public int | StockLocation $location = 0; + public ?int $type = null; + public int $x = 0; public int $y = 0; diff --git a/Models/StockType.php b/Models/StockType.php new file mode 100644 index 0000000..df06d43 --- /dev/null +++ b/Models/StockType.php @@ -0,0 +1,44 @@ + + */ +final class StockMapper extends DataMapperFactory +{ + /** + * Columns. + * + * @var array + * @since 1.0.0 + */ + public const COLUMNS = [ + 'warehousemgmt_stock_type_id' => ['name' => 'warehousemgmt_stock_type_id', 'type' => 'int', 'internal' => 'id'], + 'warehousemgmt_stock_type_name' => ['name' => 'warehousemgmt_stock_type_name', 'type' => 'string', 'internal' => 'name'], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + public const TABLE = 'warehousemgmt_stock_type'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + public const PRIMARYFIELD = 'warehousemgmt_stock_type_id'; +}