feat(BE-59,60,61): build stock transfer API with validation and audit log

- Implement CreateOne for stock transfer with multi-delivery and validation
- Preload warehouse, location, and area relations in transfer response
- Add audit log for transfer
- Improve transaction handling and error management
This commit is contained in:
aguhh18
2025-10-15 22:25:50 +07:00
parent d1b377ddac
commit 4107cf19ec
10 changed files with 219 additions and 77 deletions
@@ -9,7 +9,6 @@ CREATE TABLE IF NOT EXISTS stock_transfer_details (
quantity NUMERIC(15, 3) NOT NULL CHECK (quantity > 0),
before_quantity NUMERIC(15, 3),
after_quantity NUMERIC(15, 3),
note TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
deleted_at TIMESTAMPTZ
@@ -12,7 +12,6 @@ CREATE TABLE IF NOT EXISTS stock_transfer_deliveries (
document_path TEXT,
shipping_cost_item NUMERIC(15,3),
shipping_cost_total NUMERIC(15,3),
note TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
deleted_at TIMESTAMPTZ