Fix code review items: atomic qty increment, unit updatedAt, suppliers/all endpoint, SKU unique index

This commit is contained in:
Ryan Moon
2026-03-31 05:08:01 -05:00
parent 5f5ba9e4a2
commit bde3ad64fd
5 changed files with 29 additions and 9 deletions

View File

@@ -73,6 +73,11 @@ export const inventoryRoutes: FastifyPluginAsync = async (app) => {
return reply.send(result)
})
app.get('/suppliers/all', { preHandler: [app.authenticate, app.requirePermission('inventory.view')] }, async (request, reply) => {
const rows = await SupplierService.listAll(app.db)
return reply.send({ data: rows })
})
app.get('/suppliers/:id', { preHandler: [app.authenticate, app.requirePermission('inventory.view')] }, async (request, reply) => {
const { id } = request.params as { id: string }
const supplier = await SupplierService.getById(app.db, id)