mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
[FEAT/BE] add product flags in stock
This commit is contained in:
@@ -861,6 +861,7 @@ func (r *RecordingRepositoryImpl) ValidateFeedProductWarehouses(ctx context.Cont
|
||||
return 0, nil
|
||||
}
|
||||
var invalidIDs []uint
|
||||
feedFlags := []string{"PAKAN", "OVK"}
|
||||
if err := r.DB().WithContext(ctx).
|
||||
Table("product_warehouses pw").
|
||||
Where("pw.id IN ?", ids).
|
||||
@@ -868,8 +869,8 @@ func (r *RecordingRepositoryImpl) ValidateFeedProductWarehouses(ctx context.Cont
|
||||
SELECT 1 FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = pw.product_id
|
||||
AND UPPER(f.name) = 'PAKAN'
|
||||
)`).
|
||||
AND UPPER(f.name) IN ?
|
||||
)`, feedFlags).
|
||||
Pluck("pw.id", &invalidIDs).Error; err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user