changes on agent

This commit is contained in:
2026-08-31 12:33:10 +05:30
parent 76554d26e5
commit ffc66462fc
9 changed files with 715 additions and 25 deletions

View File

@@ -20,4 +20,5 @@ func RegisterRoutes(app *fiber.App, f *facade.Facade) {
RegisterCustomerRoutes(api, f)
RegisterCatalogueRoutes(api, f)
RegisterPosRoutes(api, f)
RegisterUploadRoutes(api, f)
}

33
routes/uploadroutes.go Normal file
View File

@@ -0,0 +1,33 @@
package routes
import (
"nearle/facade"
"github.com/gofiber/fiber/v2"
)
// Receipts for spreadsheets sent to the catalogue ingest service.
//
// Web only, and that is not an oversight. These are a back-office audit trail —
// who uploaded what, for which shop, and whether it reached the shelf. The
// customer app has no use for any of it, and mounting them under /mob would
// publish one merchant's stocking activity to an endpoint built for shoppers.
func RegisterUploadRoutes(api fiber.Router, f *facade.Facade) {
uploads := api.Group("/v1/web/uploads")
// Written the instant a drop is accepted. The batch id is the only
// credential for reading the result back, and the ingest service deletes an
// unreviewed drop after seven days — so this is the call that keeps an
// upload findable at all.
uploads.Post("/record", f.CatalogueUploadController.RecordUpload)
uploads.Get("/list", f.CatalogueUploadController.GetUploads)
// Progress, cached from whichever browser is polling the ingest service.
uploads.Put("/update", f.CatalogueUploadController.UpdateUpload)
// The other half: priced, shelved and stocked at a branch. Kept apart from
// /update because the ingest service confirms the shared global catalogue
// and knows nothing about a shop's shelf.
uploads.Put("/shelved", f.CatalogueUploadController.MarkShelved)
}