orders
This commit is contained in:
@@ -385,6 +385,23 @@ func (ctl *ProductController) GetAllProducts(c *fiber.Ctx) error {
|
||||
categoryID, subcategoryID, productID, applocationID, tenantID,
|
||||
locationID, keyword, productStatus, approve, pageno, pagesize,
|
||||
)
|
||||
|
||||
// The customer app is not shown what the shop cannot sell.
|
||||
//
|
||||
// Scoped to the /v1/mob base rather than applied in the service, because
|
||||
// this one handler answers on BOTH bases and the two callers want opposite
|
||||
// things. The console reads it to restock — an empty line is exactly what a
|
||||
// merchant needs to see and act on, so filtering there would hide the work.
|
||||
// A shopper reading the same list can only be misled by it: measured
|
||||
// 2026-09-02 on R mart, four products were on offer in the app with a zero
|
||||
// balance, including Cadbury Bournvita 500g and two Amul packs. Ordering one
|
||||
// gets a 409 at checkout, after the shopper has chosen it.
|
||||
//
|
||||
// It filters on Productstock, the same number the response carries, so the
|
||||
// list and the figure beside it cannot disagree.
|
||||
if err == nil && isAppRequest(c) {
|
||||
details = services.InStockOnlyGrouped(details)
|
||||
}
|
||||
if err != nil {
|
||||
return c.JSON(fiber.Map{
|
||||
"status": false,
|
||||
|
||||
Reference in New Issue
Block a user