3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-25 14:50:36 +00:00

5 Commits

Author SHA1 Message Date
67960eae70 Still more tests 2026-08-21 16:06:41 +01:00
6090955b45 Moar tests 2026-08-21 11:12:16 +01:00
9c13951d32 Updated tests 2026-08-20 16:28:22 +01:00
dde71b37a6 Added/updated tests 2026-08-20 16:07:01 +01:00
409e11dca4 Make accessories requestable
Accessories can now be flagged as requestable and requested by users from
the requestable items page, the same way assets and asset models already
can. No migration is needed since the accessories table already carries a
requestable column.

I kept the semantics deliberately simple: a request just records intent
(and the requested quantity) and notifies the admins. It does not touch or
reserve stock. The admin still performs the normal checkout, which is what
actually decrements quantity. That way requests behave the same for unique
assets and for quantity-based accessories, instead of inventing a separate
"reserved" state.

The admin "Requested" queue already lists every checkout request
polymorphically (it showed asset models too), so accessory requests appear
there as well; I extended that view to render the accessory name, image and
a checkout action so an admin can actually see and fulfil the request.

While wiring this up I also fixed a pre-existing bug in the request flow:
the Requestable trait saved a 'qty' key, but the column is 'quantity' and
wasn't fillable, so requested quantities were being silently dropped (this
affected asset models too). Quantity is now persisted and read back
correctly.

Components and licenses can follow the same pattern; they each just need a
small migration to add the requestable column.
2026-06-10 19:57:53 +02:00