feat(BE-34): extend DB schema and update master data APIs [partial]

 DB Schema: product_warehouse entity and migration
 Master Data: added filter params to getall APIs
🚧 Pending: stock_logs implementation and adjustment APIs
This commit is contained in:
aguhh18
2025-10-09 13:33:30 +07:00
parent 2d49ffe4cd
commit a0bdc7b23c
33 changed files with 1203 additions and 10 deletions
@@ -54,6 +54,12 @@ func (s kandangService) GetAll(c *fiber.Ctx, params *validation.Query) ([]entity
if params.Search != "" {
return db.Where("name LIKE ?", "%"+params.Search+"%")
}
if params.LocationId != 0 {
db = db.Where("location_id = ?", params.LocationId)
}
if params.PicId != 0 {
db = db.Where("pic_id = ?", params.PicId)
}
return db.Order("created_at DESC").Order("updated_at DESC")
})