Skip to content

Conversation

@zorguiala
Copy link
Owner

This pull request introduces significant updates to the inventory management system, including new features, database schema changes, and additional entity definitions. The changes aim to enhance inventory tracking, wastage management, and reconciliation workflows. Below is a breakdown of the most important changes grouped by theme:

Inventory Management Features

  • Updated TASKS.md to reflect the progress of advanced inventory management features, marking tasks like low stock alerts, predictive stock forecasting, and inventory valuation reports as completed. Added a new section for testing and integration tasks.

Database Schema Updates

  • Added new columns (leadTimeDays, costPrice, productId) to the product and inventory_transaction tables, along with foreign key constraints and updated default values. [1] [2]
  • Modified inventory_transactions to include new transaction types (in, out, waste) and updated the enum type.
  • Adjusted column types and nullability for inventory_batches, inventory_wastage, inventory_counts, and related tables to improve data integrity.

New Entities

  • Introduced InventoryBatch entity to track batch-level inventory details, including batch numbers, quantities, costs, and expiry dates.
  • Added InventoryCount and InventoryCountItem entities to support inventory reconciliation workflows, including fields for expected vs. actual quantities and discrepancies.
  • Created InventoryWastage entity to log wastage events, including reasons (e.g., expired, damaged) and associated metadata.

Codebase Integration

  • Integrated the new entities (InventoryBatch, InventoryWastage, InventoryCount, InventoryCountItem) into backend/data-source.ts and backend/src/config/database.config.ts for ORM configuration. [1] [2] [3] [4]

Migration Scripts

  • Added migration scripts to handle schema changes, including adding new columns, updating enums, and altering column types. These scripts ensure seamless database updates. [1] [2] [3]

These updates collectively enhance the system's ability to manage inventory efficiently and accurately, laying the groundwork for advanced reporting and operational workflows.

@zorguiala zorguiala added the enhancement New feature or request label May 4, 2025
@zorguiala zorguiala self-assigned this May 4, 2025
@zorguiala zorguiala merged commit 1d9c68d into main May 4, 2025
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants