Skip to content

Commit ab9f7c8

Browse files
committed
feat(place/staff_api): add new filters for fetching assets
1 parent dadaca6 commit ab9f7c8

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

drivers/place/staff_api.cr

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,13 +1078,27 @@ class Place::StaffAPI < PlaceOS::Driver
10781078
JSON.parse(response.body)
10791079
end
10801080

1081-
def assets(type_id : String? = nil, zone_id : String? = nil, order_id : String? = nil, barcode : String? = nil, serial_number : String? = nil)
1081+
def assets(
1082+
type_id : String? = nil,
1083+
zone_id : String? = nil,
1084+
order_id : String? = nil,
1085+
barcode : String? = nil,
1086+
serial_number : String? = nil,
1087+
bookable : Bool? = nil,
1088+
accessible : Bool? = nil,
1089+
features : Array(String)? = nil,
1090+
zones : Array(String)? = nil,
1091+
)
10821092
params = URI::Params.new
10831093
params["type_id"] = type_id.to_s if type_id.presence
10841094
params["zone_id"] = zone_id.to_s if zone_id.presence
10851095
params["order_id"] = order_id.to_s if order_id.presence
10861096
params["barcode"] = barcode.to_s if barcode.presence
10871097
params["serial_number"] = serial_number.to_s if serial_number.presence
1098+
params["bookable"] = bookable.to_s unless bookable.nil?
1099+
params["accessible"] = accessible.to_s unless accessible.nil?
1100+
params["features"] = features.join(',') if features && !features.empty?
1101+
params["zones"] = zones.join(',') if zones && !zones.empty?
10881102
params["limit"] = 1000.to_s
10891103
logger.debug { "getting assets (#{params})" }
10901104
response = get("/api/engine/v2/assets", params, headers: authentication)

0 commit comments

Comments
 (0)