(BE-58,,59): extend db schema & build stock transfer api

- Extend DB schema for stock transfers
- Build stock transfer API (create,)
This commit is contained in:
aguhh18
2025-10-14 22:16:50 +07:00
parent 5283aed996
commit 9b016dc30a
25 changed files with 897 additions and 0 deletions
@@ -0,0 +1,22 @@
package entities
import "time"
// DETAIL PRODUK
type StockTransferDetail struct {
Id uint64 `gorm:"primaryKey;autoIncrement"`
StockTransferId uint64
ProductId uint64
Quantity float64
BeforeQuantity float64
AfterQuantity float64
Note string
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `gorm:"index"`
// Relations
StockTransfer *StockTransfer `gorm:"foreignKey:StockTransferId"`
Product *Product `gorm:"foreignKey:ProductId"`
DeliveryItems []StockTransferDeliveryItem `gorm:"foreignKey:StockTransferDetailId"`
}