feat(BE-58,59,60,61): implement stock transfer API, validation, audit log, and schema update

- Build stock transfer API with nested details, deliveries, and items
- Extend DB schema for stock transfers
- Implement validation for transfer request and stock
- Prepare/implement transfer audit log structure
- Preload all relations for complete response
- Update DTOs for nested response
- Remove redundant root fields, use relation objects
This commit is contained in:
aguhh18
2025-10-15 11:20:32 +07:00
parent 9b016dc30a
commit d1b377ddac
6 changed files with 210 additions and 44 deletions
@@ -316,7 +316,7 @@ CREATE TABLE stock_logs (
before_quantity NUMERIC(15, 3) NOT NULL,
after_quantity NUMERIC(15, 3) NOT NULL,
log_type VARCHAR(50) NOT NULL,
log_id BIGINT ,
log_id BIGINT,
note TEXT,
product_warehouse_id BIGINT NOT NULL REFERENCES product_warehouses (id) ON DELETE CASCADE ON UPDATE CASCADE,
created_by BIGINT NOT NULL REFERENCES users (id) ON DELETE SET NULL ON UPDATE CASCADE,