mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
fix(BE-48): improve adjustment history filtering and fix pointer conversion
- Add search parameter to adjustment history API - Fix JOIN query logic to avoid duplicate JOINs - Use EXISTS subquery for cleaner product/warehouse filtering - Fix pointer conversion issue in slice iteration - Improve query performance and code readability
This commit is contained in:
@@ -10,11 +10,11 @@ type ProductWarehouse struct {
|
||||
Id uint `json:"id" gorm:"primaryKey;autoIncrement"`
|
||||
ProductId uint `json:"product_id" gorm:"not null"`
|
||||
WarehouseId uint `json:"warehouse_id" gorm:"not null"`
|
||||
Quantity float64 `json:"quantity" gorm:"default:0"`
|
||||
Quantity float64 `json:"quantity" gorm:"default:0"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
||||
CreatedBy uint `json:"created_by" gorm:"not null"`
|
||||
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
|
||||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||||
|
||||
// Relations
|
||||
Product Product `json:"product,omitempty" gorm:"foreignKey:ProductId;references:Id"`
|
||||
|
||||
Reference in New Issue
Block a user