changed generate_order_number method for insure that generated numbers never finish #5102
Fix broken specs from order number refactoring, and improve performance. Fixes #5102
Fix payment state in order importer. Fixes #5109
Allow assigning source_id and source_type rather than creating a new source.
Use rand(10) to cover all digits 0-9. Fixes #5113
Revert "Allow assigning source_id and source_type rather than creating a new source."

This reverts commit 66b61b1e10c6823bbbd6d4c5ff51cf736ca92259.
Fix credit card reuse on spree api
Dont update inventory if order has no delivery step
Load current user roles on api requests

Conflicts:
	api/app/views/spree/api/variants/small.v1.rabl
Admin users should be able to set any param via api importer
Add items before creating shipments on importer

Otherwise order.contents.add would wipe out shipments every time
Try to set inventory_unit.line_item on Importer

To avoid exception when users want to display those imported orders in
admin
Fix shipment persistence on order importer

Besides selecting the shipment rate we also need to assign the cost in
the shipment itself.

We cant only rely on order.update_shipment_state to actually well update
the order shipment_state (:O) because shipment states might not be sync
with the latest payment changes which influence on the result so
Shipment#determine_state needs to run to make sure we keep those
accurate